所以我可能失去了一些東西很明顯,但我不能讓一個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