我想在UIScrollView
中有UIImageView
。但是,我加載它時沒有顯示任何圖片。我的代碼看起來像這樣在我viewController
在功能viewDidLoad
:UIImageView在UIScrollView?
UIImage *image = [UIImage imageNamed:@"plan.gif"];
imageView = [[UIImageView alloc] initWithImage:image];
scrollView = [[UIScrollView alloc] init];
[scrollView addSubview:imageView];
scrollView.contentSize = image.size;
[self updateUI];
在我didFinishLaunchingWithOptions:
TestAppViewController *tavc = [[TestAppViewController alloc] init];
[self.window addSubview:tavc.view];
你添加了:[self.view addSubview:scrollView]; ?或者它缺少? – AmineG