我想在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