我想通過addsubiew在scrollview上放置一個uiimageview,但沒有顯示。這是viewDidLoad中的代碼:Addsubview not showing uiimageview
UIImage *buttonImage = [UIImage imageNamed:@"button"];
UIImageView *buttonImageview = [[UIImageView alloc] initWithImage:buttonImage];
buttonImageview.frame = (CGRect){.origin=CGPointMake(0.0f, 0.0f), .size=buttonImage.size};
[self.scrollView addSubview:buttonImageview];
我在做什麼錯?
我沒有把擴展名放到button.png或[email protected]。 – pedroremedios 2012-07-23 20:24:47
我試過了button.png – pedroremedios 2012-07-23 20:34:30
@pedroremedios你試過把它加到非滾動視圖嗎? – 2012-07-23 20:57:21