简体   繁体   中英

Changing parameters on iOS device orientation

I have a Tabbar project in which one one the tabs should be on landscape mode. I've seen than the Tabbar controller only allows it only if all its views allow it. Son now I'm somehow forced to adapt all the views for both portrait and landscape mode, which I've never did before.

Am I right assuming that all should be done under:

-(void)willAnimateRotationToInterfaceOrientation...

so what happens with subview which are lazyly initialized? such as a footerView on a tableView?

Another thing is, I have a method to scroll the tableView so nothing is kept under the keyboard when it's called. The method uses a constant float + a variable. In landscape mode, the constant should be another.

Any feedback would be appreciated. Thanks in advance!

Read up on autoresizingmask - setting this attribute on your views will automate a lot of the orientation resizing. And yes, you'll need a landscape and a portrait value for your constant.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM