【发布时间】:2015-11-26 08:18:42
【问题描述】:
我是 iOS 新手,
我面临UIScrollView 的问题。卷轴在这不起作用,您能帮帮我吗:
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(10, 310,300, 999)];
label.text = self.selString;
label.numberOfLines = 0;
// [self.view addSubview:label];
UIImageView *image =
[[UIImageView alloc] initWithFrame:CGRectMake(10, 20, 300, 300)];
image.backgroundColor = [UIColor greenColor];
image.tag = 50;
image.userInteractionEnabled=YES;
image.autoresizesSubviews = YES;
image.alpha = 0.93;
image.image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://opensum.in/app_test_f1/45djx96.jpg"]]]; // working code
//[self.view addSubview:image];
self.title = @"Full Blog";
CGRect scrollViewFrame = CGRectMake(0,0, 320, 999);
scrollView = [[UIScrollView alloc] initWithFrame:scrollViewFrame];
scrollView.pagingEnabled =YES;
[self.view addSubview:scrollView];
scrollView.tag=1000;
[scrollView addSubview:label];
[scrollView addSubview:image];
【问题讨论】:
-
UIScrollView not scrolling 的可能重复项
标签: ios objective-c iphone uiscrollview contentsize