我想在我的gouped表视图中添加页脚视图 现在我有这个:
NSLog(@"width:%f",self.view.frame.size.width);
UILabel *lblInfo = [[UILabel alloc] initWithFrame:CGRectMake(50, 30,self.view.frame.size.width - 100, 70)];
lblInfo.text = @"Hellow";
[footerView addSubview:lblInfo];
[lblInfo release];
给我这个结果:http://img256.imageshack.us/i/schermafbeelding2010102t.png/ 这是landscape和self.view是我的splitcontrol的详细视图的推送子视图。 第一个的nslog: - >宽度:703
如果我转向(纵向)它我得到这个结果:http://img821.imageshack.us/i/schermafbeelding2010102.png/ 第二个nslog: - >宽度:768
通常两个页脚视图应该有一个左和右;右边距为50px ......
我在监督什么?
答案 0 :(得分:1)
您应该设置 autoresizingMask :
lblInfo.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin;
您还应注意使用页脚大小创建标签:
UILabel *lblInfo = [[UILabel alloc] initWithFrame:CGRectMake(50, 30,footerView.frame.size.width - 100, 70)];