Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 5    Views: 437

mutzy
Aspiring developer
Profile
Posts: 841
Reg: Nov 03, 2010
Medford, MA
9,860
01/03/13 11:30 AM (13 years ago)

help with xib files landscape vs portrait

I am trying to set up a custom iPad xib file that has two UIviews in the same xib... one for portrait view and one landscape view. Yet when I click on File's owner it only lets me connect one of these to the "view". So when I run in the simulator the screen will rotate but will only use either the portrait view for both. Anyone know how to set it up so it will select the landscape view when in landscape? Am I even making sense?? Josh PS, love the membership plans! Just signed up!!
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
01/03/13 12:49 PM (13 years ago)
I did a lot of research on this a while back when working on something. The approach that seemed to outweigh all others was to "programatically" change the layout based on the device orientation. There is a way to change views, but most people seemed to just re-code the layout in a single XIB. Hope that helps. If not, I'll try to answer any other questions.
 
mutzy
Aspiring developer
Profile
Posts: 841
Reg: Nov 03, 2010
Medford, MA
9,860
like
01/03/13 02:12 PM (13 years ago)
I came to the same conclusion... BUT with more digging just found the following blog post that answers my EXACT question! http://www.theappcodeblog.com/2011/03/30/orientation-change-tutorial-change-the-view-when-the-orientation-changes/ Now it works perfectly! Hopefully it doesn't slow my app down at all. Thanks again, Josh
 
ATRAIN53
Code is Art
Profile
Posts: 1755
Reg: Nov 17, 2011
Chicago
26,450
like
01/04/13 07:56 AM (13 years ago)
Nice find - that looks like a solid solution. Those may be old Xcode 3 screens in that tut, but the steps and sample code look great. Thanks!
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
01/04/13 11:02 AM (13 years ago)
Also, check out his YouTube channel under the name of "TheAppCodeBlog" From his Tweets, Kent Marsh has shifted over to Microsoft .NET programming due to his job. Yet his blog and video tutorials still have relevancy. -- Niraj
 
MGoBlue
Apple Fan
Profile
Posts: 980
Reg: Jun 07, 2011
Gold River, CA
10,600
like
02/19/13 06:03 PM (12 years ago)
Hey Josh, Were you able to get this working? I'm having a dogonne time trying to make this work. I've got a cool screen for iPhone, but rotation kills it. Would like to be able to rotate, and to then apply the same to the iPad version once I get it going. Any help would be appreciated. Jeff
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.