Using a UITableViewController with a small-sized table?

后端 未结 11 1317
一生所求
一生所求 2020-12-31 05:51

When using a UITableViewController, the initWithStyle: method automatically creates the underlying UITableView with - according to the documentation - \"the correct dimensio

11条回答
  •  星月不相逢
    2020-12-31 06:37

    I had the same problem and I solved it with:

    -(void) loadView {
        [self setView:[[[UIView alloc] initWithFrame:CGRectZero] autorelease]];
        [[self view] setAutoresizesSubviews:NO];
    
        /* Create & configure table and other views... */
    
        [self setResultsTable:[[RadarTableViewController alloc] initWithNibName:nil bundle:nil]];
        [[resultsTable view] setFrame:CGRectMake(0,45,320,200)];
    }
    

    This is done in the parent (just a plain UIViewController in my case) controller.

提交回复
热议问题