我试图让它与 ViewController 视图中的代码一起使用:
但我无法让它工作。
我试过了
-(void)loadView {
UIView *contentView = [[[UIView alloc] init] autorelease];
self.view = contentView;
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
button.frame = CGRectMake(5,5,0,100);
button.autoresizingMask = UIViewAutoresizingFlexibleWidth;
[contentView addSubview:button];
}
但是按钮的宽度仍然是超级视图的宽度......
我敢肯定有一个简单的解释。
谢谢大家!
安东尼奥