| iOS Development Discussion on developing apps for the iOS platform. |
| Post Reply | New Thread | Subscribe |
|
|
Thread Tools |
![]() Member Since: Jun 03, 2011
Posts: 54
![]() |
Dear All
I have created login screen using IB. And in add-info.plist , in type: "main nib base file name", I have written name of the xib which I created using IB. Now in application delegate's didFinishLaunchingWithOptions method, I am simply writing [window makeKeyAndVisible]; return YES This way, the login view (login xib)is loaded as soon as I start the application.But my problem is that this is always launched in portrait mode and there is no rotation when simulator/iPad is rotated. My query is that If I make two xib: one for portrait mode and other for landscape mode, how is it possible to load the one depending on the device orientation. Also, when I open the xib in IB, in attribute inspector, orientation of xib is always seen in default portrait (in orientation field) and I am unable to change it as it is disabled. Any idea is appreciated. Regards |
| QUOTE Thanks | |
![]() Member Since: Aug 13, 2011
Location: West Sussex, UK
Posts: 143
![]() |
I think you would be better off creating a UIViewController class, then loading the xib file from that controller class's initWithNibName:bundle: method.
That way you can use the UIViewController class's shouldAutorotateToInterfaceOrientation: method, like this. Code:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)io
{
return (io == UIInterfaceOrientationPortrait || UIInterfaceOrientationIsLandscape(io);
}
to the correct orientation. Hope this helps. Regards Mark |
| QUOTE Thanks | |
| Post Reply | New Thread | Subscribe |
| Thread Tools | |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
|
|||||||
Thread |
Thread Starter |
Forum |
Replies |
Last Post |
| problem with terminal | walkntalk | OS X - Operating System | 6 | 08-16-2011 02:36 PM |
| Tablet? Gaming device? | dan828 | Apple Rumors and Reports | 1 | 01-30-2006 09:14 PM |
All times are GMT -4. The time now is 06:43 AM.
Powered by vBulletin