所以我可能失去了一些东西很明显,但我不能让一个UIButton在我UIButton的帧大小始终为零
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
函数创建正确的尺寸:
callerPlayerBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[callerPlayerBtn setImage:[UIImage imageNamed:@"callPlayerBtn"] forState:UIControlStateNormal];
[self.view addSubview:callerPlayerBtn];
NSLog(@"SIZES ARE %f %f", callerPlayerBtn.bounds.size.width, callerPlayerBtn.bounds.size.height);
我在做什么错?日志始终为0
。我想访问它的维度来集中它。 谢谢
好的答案+1。 – 2013-03-12 14:38:49