Strange properties of the TTTableViewController three20 frame

I am adding TTTableViewControllerto the existing UIViewControllerone strange thing that I discovered is that the properties of the frameinitialized TTTableViewController are connected, for example. in iOS layout.

I have:

  • UIStatusBar
  • UINavigationController
  • UIViewController
  • UITabBar

To set to TTTableViewControllerfill all the remaining space, I need to set the height to 460 instead of 367. (367 = 480-20-44-49)

eg.

self.tableViewController.view.frame = CGRectMake(0, 0, 320, 460.0f);

instead

self.tableViewController.view.frame = CGRectMake(0, 0, 320, 367.0f);

Why is this so?

* Edit for clarification: I mean the TTTableViewController at the top of the TTViewController (using [self.view addSubview: self.tableViewController.view];) and I need to set self.tableViewController.view.frame = CGRectMake (0, 0, 320 , 460.0f); instead of 367

+5
4

, , . , viewDidLoad, , , . . 320: 460, , , . 320: 367, , ( ), . viewDidLoad, (, viewWillAppear?) 320: 460.

, . , . .

+2

, 480-20 = 460. - 22 ,

, view , . , 20 , - , , -.

, . . !!
+2

.

You must submit TTTableViewControllerusing the presence / firing functions of the controller. if you do not want to enable the slide effect, so users will not see that it is a “different screen”, use the boolean flag when you present the controller.

   [self presentModalViewController:vc animated:NO];

Alternatively, use TTTableViewwithout a controller:

tableView = [[TTTableView alloc] initWithFrame:CGRectMake(0, kScrollViewHeight + kSignupLabelHeight, 320, kTableViewHeight) style:UITableViewStyleGrouped];
[tableView setBackgroundColor:[UIColor clearColor]];

tableView.delegate = self;
tableView.dataSource = [TTSectionedDataSource dataSourceWithObjects:
                                 @"",
                                 [TTTableTextItem itemWithText:@"Sign Up" URL:@"tt://signupController"],
                                 nil];
[self.view addSubview:tableView];
+1
source

Like this code. if you are using iOS6, get the current device. if();

-(void)viewdidLoad{

TTTableViewController *tt = [TTTableViewController new]; CGRect frame = [UIScreen mainScreen].bounds; tt.frame = frame; tt.delegate = self;

[self.view addsubview:tt];

}

0
source

All Articles