1
我想在我的UIScrollView中插入一個更多的圖像。問題是:我所有的舊內容仍然是可滾動的,但是該圖片在頁面頂部保持靜態。有人知道解決方案嗎?uiscrollview不滾動uiimageview
代碼:
- (void)viewDidLoad {
CGRect myImageRect = CGRectMake(0.0f, 0.0f, 320.0f, 109.0f);
myImage = [[UIImageView alloc] initWithFrame:myImageRect];
UIImage * img = [[UIImage alloc] initWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@"www.somelink.com"]]];
myImage.image = img;
myImage.opaque = YES; // explicitly opaque for performance
[scrollView addSubview:myImage];
[myImage release];
}
問候。