2013-07-20 28 views
1

我試圖模仿iPad Mail應用程序。在肖像模式下,當popover的搜索欄有第一響應者並且我旋轉到橫向時,popover的搜索欄會丟失第一響應者。我想要在縱向模式下第一響應者處於橫向模式時繼續爲搜索欄提供第一響應者。我怎樣才能做到這一點?當從縱向模式旋轉到橫向模式時,搜索欄會丟失FirstResponder

人像模式: http://postimg.org/image/kwjs9xkcx/

後旋轉: http://postimg.org/image/al7fh9snl/ 注意,搜索欄辭職第一響應。

謝謝!

+0

這是我真正想要的(搜索欄有第一響應者): http://postimg.org/image/5cgzx4zm9/ – Woodless

回答

0

與視圖

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation; 

檢查輪替]交易,看看你在

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 

    if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight) { 
     [searchBar becomeFirstResponder]; 
    } 
} 

希望幫助什麼接口裏面的方法!

相關問題