【问题标题】:Detect UIPopover resize event检测 UIPopover 调整大小事件
【发布时间】:2012-08-14 04:11:19
【问题描述】:

在 iOS 中,我在 UIPopover 中的 UIView 中显示一些内容。有时显示键盘时弹出框会调整大小。 UIView 是否有特定的事件可以用来调整子视图等的大小?如果没有,检测调整大小事件的最佳方法是什么?

【问题讨论】:

    标签: ios cocoa-touch uiview uiviewcontroller uipopover


    【解决方案1】:

    您可能必须在调用键盘的委托方法中检测到这一点,例如,如果它是 UITextField 之类的 - (void)textFieldDidBeginEditing:(UITextField *)textField

    this post 中描述的另一个选项是使用UIKeyboardListener 列出有关键盘是否可见的通知。

    UIPopoverController 不幸的是只有两个委托方法,它们与弹出关闭有关。

     - (void)popoverControllerDidDismissPopover:(UIPopoverController
       *)popoverController
     - (BOOL)popoverControllerShouldDismissPopover:(UIPopoverController *)popoverController
    

    【讨论】:

      猜你喜欢
      • 2011-12-26
      • 1970-01-01
      • 2012-03-18
      • 2021-12-08
      • 1970-01-01
      • 2012-12-31
      • 2011-01-13
      • 2019-02-01
      • 2022-10-01
      相关资源
      最近更新 更多