Search code examples
iphoneobjective-cipaduisplitviewcontrolleruisplitview

UISplitView question and issues


I created a new project with a UISplitViewApplication. When you do this you will find a DetailViewController and RootViewController. In the DetailViewController there is a UIToolbar on top that resizes according to the orientation, whether it's potrait or landscape. I accidentally removed this UIToolBar and I dragged a new one from the FileManager window, however after connecting everything this new one doesn't resizes according to the orientation. Why is this?

Also one more issue I am facing is related to this orientation stuff. I added a UITextField and UITableView, etc in this DetailView, however when switching in between the orientation everything is just messed up. How can I prevent this? How do I make my view consistent no matter what orientation it has...


Solution

  • Have you looked in the measurements inspector to see how the struts and springs are set up for the toolbar, etc? A lot of times, you can use springs and struts to control how your UI will react to orientation changes. Sometimes, you have to do it in code.

    If you're not sure how to do that, here's a link with some good info on this subject.

    http://www.techotopia.com/index.php/IOS_4_iPhone_Rotation,_View_Resizing_and_Layout_Handling_(Xcode_4)

    Hope this helps.

    Jamie