1
我已经子类UITableViewCell并通过layoutSubviews方法合并了一些子视图。所有视图分配,并在initWithStyle方法启动,帧在layoutSubviews方法设置,像这样:自动调整子类UITableViewCell子视图
initWithStyle:... {
UILabel *myLabel = [[UILabel alloc] initWithFrame:CGRectZero];
myLabel.someProperties = Configured;
[self.contentView addSubview:myLabel];
layoutSubviews {
CGRect labelRect = CGRectMake(10.0f, 5.0f, 35.0f, 180.0f);
myLabel.frame = labelRect;
设置在的viewController的shouldAutoRotateOrientation为YES旋转NavigationController,的tableView和UIToolbar适当的,但内容tableViewCells不会移动。至于AutoResizingMasks,我不清楚要添加到哪里或要添加什么内容。到目前为止我尝试过的组合都没有做任何事情。有人能帮我一把吗?
谢谢!
不当您旋转设备时调用layoutSubviews? – Skie 2010-04-27 16:49:28
我不确定。我必须尝试NSLog并看看。 – Justin 2010-04-27 17:48:46