【问题标题】:How to present a modalView just above the control which makes it pop up?如何在控件上方显示一个 modalView 使其弹出?
【发布时间】:2011-04-30 09:14:59
【问题描述】:

如何创建一个模式以在单击的按钮上方弹出?

如上图所示,弹出窗口就在“像婴儿一样睡觉”按钮的上方。

我希望模态框以类似的方式弹出。

我该怎么做?

【问题讨论】:

    标签: iphone objective-c cocoa-touch ipad


    【解决方案1】:

    您可以通过使用动画更改弹出视图的框架来做到这一点 -

    [popUpView setFrame:];
    
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:0.5];
    [popUpView setFrame:];
    [UIView commitAnimations];
    

    【讨论】:

    • 所以PopUpView 应该只是同一个 ViewController 中的 UIView?还是应该是单独的 ViewController?
    • 两者都可以,但我更喜欢同一类的 UIView。
    • 好的。谢谢,我会尝试并回复你
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-10-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多