Note that there are some explanatory texts on larger screens.

plurals
  1. POiOS - UIView Doesn't resize in landscape
    primarykey
    data
    text
    <p>something really weird it's happening to me (at least weird for me) I have a view controller (fileManagerViewController) the UI of this is basically an empty view with a toolbar on top. I made this UI with IB. on the toolbar i have some buttons, two of those buttons are used to switch between two views. The UI for the two views that I've to switch was made by code.</p> <ul> <li>Inside the viewDidLoad of FileManagerViewController I wrote this</li> </ul> <pre><code> -(void) viewDidLoad { [super viewDidLoad]; fileManagerTableView = [[FileManagerTableView alloc] init]; fileManagerGridView = [[FileManagerGridView alloc] init]; self.view.autoresizingMask = UIViewAutoresizingFlexibleHeight |UIViewAutoresizingFlexibleWidth; self.view.autoresizesSubviews=YES; self.view addSubview:fileManagerTableView.view]; [self.view addSubview:fileManagerGridView.view]; [fileManagerTableView.view setHidden:YES]; } </code></pre> <ul> <li>those are the two loadView methods</li> </ul> <pre><code> -(void) loadView { CGRect fileGridViewFrame = CGRectMake(0.0, 50.0, 1024,768); fileGridView = [[[AQGridView alloc] initWithFrame:fileGridViewFrame] autorelease]; fileGridView.dataSource=self; fileGridView.delegate=self; fileGridView.autoresizingMask=UIViewAutoresizingFlexibleWidth| UIViewAutoresizingFlexibleHeight fileGridView.autoresizesSubviews=YES; fileGridView.bounces; fileGridView.backgroundColor = [[UIColor colorWithPatternImage: [UIImage imageNamed:@"bg.png"]]]; [self.fileGridView reloadData]; self.view = fileGridView; } </code></pre> <pre><code> -(void) loadView { CGRect fileTableViewFrame = CGRectMake(0.0, 44.0, 1024,768); fileGridView = [[[UITableView alloc] initWithFrame:fileTableViewFrame] autorelease]; fileGridView.dataSource=self; fileGridView.delegate=self; fileGridView.autoresizingMask=UIViewAutoresizingFlexibleWidth| UIViewAutoresizingFlexibleHeight fileGridView.autoresizesSubviews=YES; fileGridView.bounces; fileGridView.backgroundColor = [[UIColor colorWithPatternImage: [UIImage imageNamed:@"bg.png"]]]; [self.fileGridView reloadData]; self.view = fileGridView; } </code></pre> <p>the result is, as i said weird, if the app start in portrait mode all works as I expect the two view s are rendered well in portrait and landscape mode. If the app is started with the device in landscape orientation the views don't fill the entire screen. Have a look a this <a href="http://img88.imageshack.us/i/schermata20110127a16553.jpg/" rel="nofollow">screenshot</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload