开发者

Rotating the UIOrientation of a specific view

开发者 https://www.devze.com 2023-03-10 13:03 出处:网络
In a TabBarController the UI of a view will only r开发者_Python百科otate if all of the view within the tab bar can rotate as well (according to app dev center). Is there anyway that i can specify to r

In a TabBarController the UI of a view will only r开发者_Python百科otate if all of the view within the tab bar can rotate as well (according to app dev center). Is there anyway that i can specify to rotate only 1 of 4 views within my TabBarController?


If each view has its own ViewController you can define - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation for each one.

If they are just UIViews, you could set each one to have a specific tag property, then in the controller for the tab bar check which view is showing and allow rotation based on that.

0

精彩评论

暂无评论...
验证码 换一张
取 消