【问题标题】:How do I get the position of a txtfield inside a popoverview with respect to ipad screen如何在弹出视图中获取文本字段相对于 ipad 屏幕的位置
【发布时间】:2012-01-24 13:48:59
【问题描述】:

我在视图控制器的 tableview 中有一个 UITextfield,我在 UIPopOverView 中显示这个视图。我想知道如何才能知道文本字段相对于 IPAD 屏幕的位置...这样我就可以在 Textfield editingDidBegan 上向上移动我的表格视图

【问题讨论】:

    标签: iphone ios ipad uipopovercontroller


    【解决方案1】:

    尝试使用 UIView 的 convertPoint:toView: 或 convertRect:toView: 方法。

    例如,要获取文本字段相对于窗口的边界,例如

    CGRect *bounds = [textField convertRect:textField.bounds toView:window];
    

    【讨论】:

    • 谢谢尼克,我试试看..!!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-10-07
    • 1970-01-01
    • 1970-01-01
    • 2011-06-27
    相关资源
    最近更新 更多