XCOde 4 how to rotate view in xib? - iphone

I can't rotate the view in xcode4 to landscape: the dropdown that says "orientation" (under "simulated metrics") is disabled.
Any help? Thx.

Changing Interface Builder Orientation in Xcode 4

That is only enabled if you have the status bar visible on the view I believe.

Related

iOS 7 UINavigationBar with iOS 6 style

I was developing an App for iOS 6 and this is one of my views.
Now I've updated my iPhone to iOS 7 and this is the result:
Now all the views are behind the navigation bar because iOS 7' UIViewController's views starts at the top left edge of the screen and not under the UINavigationBar as iOS 6.
Now the "email" field is behind the navigation bar.
Is there a way to use the iOS 6 style?
Thanks
Marco
STEP BY STEP WITH IMAGES
Upon reading this question I was experimenting as I had the exact same question. I then found the answer.
1) Make sure storyboard is on iOS 7
2.) Select the viewcontroller from the storyboard (In your case the Login Controller)
3.) Make sure that 'Under Top Bars' is Deselected
You need to turn off translucent for the navigation bar and that should adjust the iOS 7 constraints to be the bottom of the navigation bar again.
They have completely removed the old style for navigation bars in iOS 7. You could set the navigation bar to be an image, which could utilize the look from iOS 6, but I think it would be safer to just go with the new iOS 7 default appearance.
I had a similar problem and I fixed it by writing following code in the views' viewWillAppear method:
self.edgesForExtendedLayout = UIRectEdgeNone;

Bottom button not showing in iOS Simulator

I am developing an app for iOS in which i took new ViewController
In that ViewController i dragged two UIButtons
Here is the image of .xib file
:
but when i run this project in my simulator i am unable to see my bottom button, you can see here in my simulator,
:
Where i am doing mistake ? i am not using autolayout because my deployment target is iOS 4.3
Thanks in advance.
if we create the navigationbar and tabbar programmatically then occupies a space in our viewcontroller so if we need to set our viewcontroller from .xib properly then we must have to left the space of navigation and tabbar by selectin those from .xib so that we can have exact space left for our other stuff i'm glad that it helped you. you're welcome. :)
It seems that your trouble caused by tab bar, that you create from code. I assume, you will see your button in case of simple comment line with tab bar creation. As this button is hidden, you can change it's y position or change size of your view in xib file.
I have observed such problems when we are using different sizes of .xib and iPhone simulator
i mean to say if u are using Ratina 4 for .xib .. make sure that u r also using iPhone simulator of Ratina 4 and the frame of TabBar Controller should b (0,0,320,568)
And in the case of Ratina 3.5 it should be (0,0,320,480)

Rotate only one view controller in a tabbed application

I've read to many posts but I can't find a solution.
I've a tabbed application using storyboard. All the View Controllers of that Tabbed Application must show the content in portrait orientation, but there's only one viewcontroller (which is showing a video) that I want to be in landscape mode.
EXPLANATION OF THE STORYBOARD: TabBarController -> 4x Navigation controllers -> each navigation controller points to his ViewController -> one of these view controllers have an image, when I press that image, i've done a push to another view, the view that I want to have in landscape mode because I have there a UIWebView to show a video.
I'm unable to have all the app only in portrait orientation and the viewcontroller mentioned capable to rotate in landscape mode.
My app is also supporting iOS 5, so I know there are methods deprecated and I'm getting crazy.
I believe that in Summary > iPhone / iPod Deployment info > Supported Interface Orientations > there I've to check Portrait, Landscape left and right, and then via methods, enable or disable the rotations. I'm lost.
Can you help me?
I think you should be able to do this if you push to the view as a modal. Make sure your application's PList file (under Supporting Files folder) is set to support all orientations and then simply add the code to the modal view controller to display landscape with something like this.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOr‌​ientation
{
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
Let me know if you have any luck.
As i worked out for my App i advise you to use this solution.By using some conditions in the shouldAutorotateToInterfaceOrientation method orientation type we can solve this.Just try with this link will help you.
https://stackoverflow.com/questions/12021185/ios-rotate-view-only-one-view-controllers-view/15403129#1540312

Landscape mode for Xcode using storyboard

I´m making an app for a Zoo, and it is very simple, but because at fisrt I tried to make it with code and using xcode 3.2, but I had some problems so I started it with Xcode 4.3 and am trying it with the storyboards.
My question is, how could I put all the app in landscape mode? I mean I already set it in the infoplist: the initial interface orientation, and then in the .m file I changed the following:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return UIInterfaceOrientationLandscapeRight;
}
But it doesn´t work. When I add a tabbarcontroller and link it all the views become portrait. The first one if I rotate it it does give me the landscape but all the others are always in portrait, so what can I do?
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return interfaceOrientation==UIInterfaceOrientationLandscapeRight;
}
When you add tabbar controller on storyboard, in attribute inspector of tab bar you have orientation that is on inferred by default, change it to Landscape. But is better you set orientation from summary tab of project to Landscape Right. it lets your up come up on Right landscape.

UITabbar orientation problem

I am working on orientation work on uitabbar application. I am using 5 tabbar item in tabbar. I want only 4 tab bar item to be rotated in both Landscape and potrait. but the issue is when i put "return no" to shouldAutorotateToInterfaceOrientation in non rotating tabbar item, all tab bar are not working. can anybody please tell me what i went wrong?
Thanks in advance.
Regards,
sathish
By default, a UITabBarController will only return YES to the shouldAutorotateToInterfaceOrientation: message if every one of its child controllers returns YES to that message. The behavior you're seeing is the expected behavior.
Check out the fourth list item on this page.