views:

24

answers:

0

Hi everyone,

I'm trying to draw 2 UITableViews programmatically on a landscape iPad.

I drew it first in IB to get the values for x, y, width and height from inspector, then programmatically i create CGRects with this parameters, but the final result is not what I saw in IB.

what units uses CGRecktMake to measure the frame? The UITableViews are more big than I expect :_(

MainVC *mainVC = [[MainVC alloc] init];
mainVC.view.frame = [[UIScreen mainScreen] bounds];


firstVC.view.frame  = CGRectMake(20, 
                                 0,  
                                 488,
                                 748);

secondVC.view.frame = CGRectMake(516, 
                                 0,  
                                 488, 
                                 748);
firstVC.view.backgroundColor = [UIColor grayColor];
secondVC.view.backgroundColor = [UIColor blueColor];
[mainVC.view addSubview:firstVC.view];
[mainVC.view addSubview:secondVC.view];

[window addSubview:mainVC.view]; [window makeKeyAndVisible];