- Joined
- Oct 11, 2011
- Messages
- 46
- Reaction score
- 0
- Points
- 6
- Your Mac's Specs
- 13" MacBook Pro 2.4 GHz 8 GB Ram 250 GB HD, iPhone 4/S 64 GB, iPhone 3GS 16 GB, iPad 16 GB Wi-Fi
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
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
heres my coding:
these do not work, i tried using the If statement on viewDidLoad, but it doesn't know if its in portrait mode or landscape.
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???
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
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
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);
}
}
}
}
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);
}
}
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???