开发者

can't set tableview frame in landscape, parameters set but view is strange [screenshot attached]

I try to set the frame of a UITableView to (190,0,610,768) in landscape mode. The frame parameters are correctly set but display is not correct.

To contrast the result, I added a UIlabel with same frame to 开发者_开发问答the bottom:

CGRect frame = CGRectMake(190, 0, 610, 768);

UILabel *lbtb = [[UILabel alloc] initWithFrame:frame];
lbtb.backgroundColor = [UIColor cyanColor];
lbtb.text = @"";
[self.view addSubview:lbtb];

dishMenuVC = [[DishMenuViewController alloc] init] ;
dishMenuVC.view.frame = frame;    
dishMenuVC.view.backgroundColor = [UIColor redColor];
dishMenuVC.view.alpha = 0.5;
[self.view addSubview:dishMenuVC.view];

can't set tableview frame in landscape, parameters set but view is strange [screenshot attached]


I found a workaround to this problem by creating a container UIView with my intended frame and add the tableview to its subview.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜