UISearchDisplayController叠加定位

时间:2013-10-01 12:56:56

标签: iphone ios objective-c search

我在使用UISearchDisplayController时遇到了一些困难,并且在针对iOS 7构建时它的灰色叠加层的定位。这在针对iOS 6构建时工作正常,但似乎只有

我在基础ViewController中内置了一个UIView,需要在之前的屏幕截图中显示每个页面(读取“Hello thereAnother String”)。当我导航到包含UISearchDisplayController的视图控制器时,这就是我所看到的:

enter image description here

这很好,是我期望看到的。但是,当我尝试单击视图UISearchBar时,这就是我所看到的:

enter image description here

请注意,灰色叠加层会被我需要放在应用程序的所有屏幕中的UIView的大小所抵消。

关于为什么会发生这种情况的任何想法?

1 个答案:

答案 0 :(得分:0)

你可以使用UITextfield的自定义类别并覆盖那些方法

- (CGRect)textRectForBounds:(CGRect)bounds; and 
- (CGRect)editingRectForBounds:(CGRect)bounds ; 

这个问题从这种方法发生。

相关问题