0

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?

user807146
  • 103
  • 8
  • 1
    I think problem is not with your window, It is with your table view. What my thinking is that cell are not recreated on scroll. – Shreesh Garg Dec 26 '13 at 13:12
  • Thanks for your reply, But I already recreated the cell and customizing the label as stated in the tutorial, also, reloading data with no success. The question is, Why MainWindow.xib solves the problem? – user807146 Dec 26 '13 at 16:57

0 Answers0