Horizontal table size changed when remove MainWindow.xib?

83 views Asked by At

This tutorial gives you a simple and nice horizontal UITableView

but when removing MainWindow_iPhone.xib (_iPad) and create UIWindow object programmatically in the app delegate, the horizontal table and contents (image and label) become unstable, its size changed and scroll doesn't work properly. Also, labels become hidden when scroll up.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Override point for customization after application launch.
    // self.window = [[UIWindow alloc]ini];
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
    // Override point for customization after application launch.
  //    self.window.contentMode = UIViewContentModeScaleToFill;
 //    self.window.opaque = NO;
 //    self.window.clipsToBounds = NO;
 //    self.window.clearsContextBeforeDrawing = NO;;
 //    self.window.autoresizesSubviews = YES;
  //    self.window.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;

ArticleListViewController_iPhone *masterViewController = [[[ArticleListViewController_iPhone alloc] initWithNibName:@"ArticleListViewController_iPhone" bundle:nil] autorelease];
self.navigationController = [[[UINavigationController alloc] initWithRootViewController:masterViewController] autorelease];
self.window.rootViewController = self.navigationController;


[self.window makeKeyAndVisible];

return YES;
}

I already tried all window properties that affect size with no success. If I remove my code and set MainWindow_iPhone as Main Interface, all things work well.

Also, I tried the following:

  • Clean & Build
  • Option & Clean & Build
  • Reset simulator
  • Another version of xCode
  • Another version of Mac os
  • Test on device

What the problem, Do you have any suggestions?

0

There are 0 answers