Reputation: 11
In my application i use both devices iPhone and iPad.Now the main problem is device orientation.i wanna use both portrait and landscape orientation.but i got this type of view when i rotate to right or left as below.
Also when i turned on autolayout option check then i also found new image like this.
i use firstViewController and also i put method for orientation and when i put breakpoint on it, it is not called and here is my code:
in fVC.m:
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
if (interfaceOrientation == UIDeviceOrientationLandscapeLeft || interfaceOrientation == UIDeviceOrientationLandscapeRight)
{
if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone) {
locationBtn.frame = CGRectMake(200,200,86,86);
cameraBtn.frame = CGRectMake(200,200,86,21);
}
else
{
locationBtn.frame = CGRectMake(200,200,86,86);
cameraBtn.frame = CGRectMake(230,200,86,21);
}
}
return 0;
}
Upvotes: 0
Views: 145
Reputation: 4767
Just enabling Autolayout
doesn't add any constraints.
Select your items in .XIB and choose reset to selected constraints.
This might help you achieve what you are expecting.
I would recommend you learn and start using Autolayout. Quick link to help you get started: http://www.youtube.com/watch?v=r1sc7NI6-wo
Change to do:
Output:
Upvotes: 0
Reputation: 4728
-(BOOL)shouldRotate....
Is no longer called as of iOs7.
Try moving this code to -(void)didRotate..
Or
(better, because your animations will sync with the built in ones)
-(void)willRotate...
Upvotes: 0
Reputation: 23892
Change in properties as per your need ..
You want to enlarge or you want to place elsewhere .. ..
Upvotes: 1