Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
iOS Development
Autorotation & Positioning Problem
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Loon3y" data-source="post: 1455877" data-attributes="member: 217795"><p>On my app i found this problem, when in landscape mode and i select an item which leads to another view, my description doesn't show up.</p><p></p><p></p><p>but when im in portrait view and i select the item, and than i rotate it, THEN for some reason my description shows:</p><p></p><p></p><p>heres the a photo of the view when i use the app in landscape mode only</p><p></p><p></p><p><img src="http://i47.tinypic.com/m3rk8.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p></p><p></p><p></p><p></p><p>heres the photo of the view, when i use the app in portrait mode and than rotate it to landscape when im at this view. so you guys have some type of idea what im talking about</p><p></p><p></p><p><img src="http://i48.tinypic.com/2lcvdz9.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p></p><p></p><p></p><p></p><p></p><p>heres my coding:</p><p></p><p></p><p>[CODE]- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation</p><p>{ </p><p> //return (interfaceOrientation == UIInterfaceOrientationPortrait);</p><p> </p><p> if ([[UIDevice currentDevice]userInterfaceIdiom]==UIUserInterfaceIdiomPhone)</p><p> {</p><p> return (interfaceOrientation == UIInterfaceOrientationPortrait);</p><p> }</p><p> else</p><p> {</p><p> if (UIInterfaceOrientationIsPortrait(interfaceOrientation))</p><p> {</p><p> // Portrait frames</p><p> view_style_descript.frame = CGRectMake(0, 664, 768, 90);</p><p> view_Washing_Intrn.frame=CGRectMake(0, 753, 768, 158);</p><p> //[self RemoveSubView];</p><p> //view_color.frame = CGRectMake(710, 80, view_color.frame.size.width, view_color.frame.size.height);</p><p> }</p><p> else</p><p> {</p><p> // Landscape frames</p><p> view_style_descript.frame = CGRectMake(465, 200, 560, 90);</p><p> view_Washing_Intrn.frame=CGRectMake(465, 290, 560, 250);</p><p> // [self RemoveSubView];</p><p> //view_color.frame = CGRectMake(965, 80, view_color.frame.size.width, view_color.frame.size.height);</p><p> }</p><p></p><p> return YES;</p><p> }</p><p>}</p><p></p><p></p><p></p><p>- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration</p><p>{</p><p> </p><p> if ([[UIDevice currentDevice]userInterfaceIdiom]==UIUserInterfaceIdiomPad)</p><p> {</p><p> if (UIInterfaceOrientationIsPortrait(toInterfaceOrientation))</p><p> {</p><p> // Portrait frames</p><p> view_style_descript.frame = CGRectMake(0, 664, 768, 90);</p><p> view_Washing_Intrn.frame=CGRectMake(0, 753, 768, 158);</p><p> </p><p> </p><p> if(ShowColor==FALSE)</p><p> {</p><p> view_color.frame = CGRectMake(710, 80, view_color.frame.size.width, view_color.frame.size.height);</p><p> }</p><p> else</p><p> {</p><p> view_color.frame = CGRectMake(665, 80, view_color.frame.size.width, view_color.frame.size.height);</p><p> }</p><p> }</p><p> else</p><p> {</p><p> // Landscape frames</p><p> view_style_descript.frame = CGRectMake(465, 200, 560, 90);</p><p> view_Washing_Intrn.frame=CGRectMake(465, 290, 560, 250);</p><p> if(ShowColor==FALSE)</p><p> {</p><p> view_color.frame = CGRectMake(965, 80, view_color.frame.size.width, view_color.frame.size.height);</p><p> }</p><p> else</p><p> {</p><p> view_color.frame = CGRectMake(925, 80, view_color.frame.size.width, view_color.frame.size.height);</p><p> }</p><p> }</p><p></p><p> }</p><p> </p><p>}</p><p>[/CODE]</p><p></p><p></p><p></p><p>these do not work, i tried using the If statement on viewDidLoad, but it doesn't know if its in portrait mode or landscape.</p><p></p><p></p><p>[CODE]- (void)viewDidLoad</p><p>{ </p><p> [super viewDidLoad];</p><p> </p><p> </p><p> if (UIInterfaceOrientationPortrait)</p><p> {</p><p> // Portrait frames</p><p> view_style_descript.frame = CGRectMake(0, 664, 768, 90);</p><p> view_Washing_Intrn.frame=CGRectMake(0, 753, 768, 158);</p><p> //[self RemoveSubView];</p><p> //view_color.frame = CGRectMake(710, 80, view_color.frame.size.width, view_color.frame.size.height);</p><p> }</p><p> else</p><p> {</p><p> // Landscape frames</p><p> view_style_descript.frame = CGRectMake(465, 200, 560, 90);</p><p> view_Washing_Intrn.frame=CGRectMake(465, 290, 560, 250);</p><p> // [self RemoveSubView];</p><p> //view_color.frame = CGRectMake(965, 80, view_color.frame.size.width, view_color.frame.size.height);</p><p> }</p><p></p><p>}[/CODE]</p><p></p><p>so basically if i put a "!" infront of UIInterfaceOrientationPortrait it executes the else statement, if not than the if.</p><p></p><p></p><p>anyone have any suggestions or advice???</p></blockquote><p></p>
[QUOTE="Loon3y, post: 1455877, member: 217795"] On my app i found this problem, when in landscape mode and i select an item which leads to another view, my description doesn't show up. but when im in portrait view and i select the item, and than i rotate it, THEN for some reason my description shows: heres the a photo of the view when i use the app in landscape mode only [IMG]http://i47.tinypic.com/m3rk8.png[/IMG] heres the photo of the view, when i use the app in portrait mode and than rotate it to landscape when im at this view. so you guys have some type of idea what im talking about [IMG]http://i48.tinypic.com/2lcvdz9.png[/IMG] heres my coding: [CODE]- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { //return (interfaceOrientation == UIInterfaceOrientationPortrait); if ([[UIDevice currentDevice]userInterfaceIdiom]==UIUserInterfaceIdiomPhone) { return (interfaceOrientation == UIInterfaceOrientationPortrait); } else { if (UIInterfaceOrientationIsPortrait(interfaceOrientation)) { // Portrait frames view_style_descript.frame = CGRectMake(0, 664, 768, 90); view_Washing_Intrn.frame=CGRectMake(0, 753, 768, 158); //[self RemoveSubView]; //view_color.frame = CGRectMake(710, 80, view_color.frame.size.width, view_color.frame.size.height); } else { // Landscape frames view_style_descript.frame = CGRectMake(465, 200, 560, 90); view_Washing_Intrn.frame=CGRectMake(465, 290, 560, 250); // [self RemoveSubView]; //view_color.frame = CGRectMake(965, 80, view_color.frame.size.width, view_color.frame.size.height); } return YES; } } - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { if ([[UIDevice currentDevice]userInterfaceIdiom]==UIUserInterfaceIdiomPad) { if (UIInterfaceOrientationIsPortrait(toInterfaceOrientation)) { // Portrait frames view_style_descript.frame = CGRectMake(0, 664, 768, 90); view_Washing_Intrn.frame=CGRectMake(0, 753, 768, 158); if(ShowColor==FALSE) { view_color.frame = CGRectMake(710, 80, view_color.frame.size.width, view_color.frame.size.height); } else { view_color.frame = CGRectMake(665, 80, view_color.frame.size.width, view_color.frame.size.height); } } else { // Landscape frames view_style_descript.frame = CGRectMake(465, 200, 560, 90); view_Washing_Intrn.frame=CGRectMake(465, 290, 560, 250); if(ShowColor==FALSE) { view_color.frame = CGRectMake(965, 80, view_color.frame.size.width, view_color.frame.size.height); } else { view_color.frame = CGRectMake(925, 80, view_color.frame.size.width, view_color.frame.size.height); } } } } [/CODE] these do not work, i tried using the If statement on viewDidLoad, but it doesn't know if its in portrait mode or landscape. [CODE]- (void)viewDidLoad { [super viewDidLoad]; if (UIInterfaceOrientationPortrait) { // Portrait frames view_style_descript.frame = CGRectMake(0, 664, 768, 90); view_Washing_Intrn.frame=CGRectMake(0, 753, 768, 158); //[self RemoveSubView]; //view_color.frame = CGRectMake(710, 80, view_color.frame.size.width, view_color.frame.size.height); } else { // Landscape frames view_style_descript.frame = CGRectMake(465, 200, 560, 90); view_Washing_Intrn.frame=CGRectMake(465, 290, 560, 250); // [self RemoveSubView]; //view_color.frame = CGRectMake(965, 80, view_color.frame.size.width, view_color.frame.size.height); } }[/CODE] so basically if i put a "!" infront of UIInterfaceOrientationPortrait it executes the else statement, if not than the if. anyone have any suggestions or advice??? [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
iOS Development
Autorotation & Positioning Problem
Top