小编dac*_*dac的帖子

iphone:uiscrollview不滚动?但内容设置..?

嘿人,我有一些数据,并希望在导航堆栈内的新视图中显示它.

我用XIB文件创建了一些新的viewcontroller类.然后我编辑了XIB文件并放置了以下层次结构:

1 files owner
2 first responder
3 scrollview
3.1 view
3.1.1 label1
3.1.2 label2
3.1.3 label3
3.1.4 image4
Run Code Online (Sandbox Code Playgroud)

我安排了标签和图像.标签的内容可能不同,它们应该动态调整大小.我还在viewcontroller类中完成了IBOutlets并正确连接了所有内容.文件所有者的视图委托设置为查看..

然后我加载了viewcontroller,我在"viewDidLoad"中执行 - 方法如下:

- (void)viewDidLoad {
[super viewDidLoad];

self.currentPageURL.text = [self.offerItem objectForKey: @"page-url"];
self.currentPrice.text = [self.offerItem objectForKey: @"price"];
self.currentRank.text = [self.offerItem objectForKey: @"rank"];
self.currentName.text = [self.offerItem objectForKey: @"name"];
self.currentProducerName.text = [self.offerItem objectForKey: @"producer-name"];

self.currentDescription.text = [self.offerItem objectForKey: @"description"];

self.imageViewForImage.image = [helperClass resizeImage:[self.offerItem objectForKey: @"picture"] forSize:CGSizeMake(280.0, 280.0) ];

[theScrollview setScrollEnabled:YES];
[theScrollview setContentSize:CGSizeMake(320, 1200)];
[theScrollview flashScrollIndicators];

[theScrollview addSubview:theView];
Run Code Online (Sandbox Code Playgroud)

}

当我在我的模拟器中启动应用程序时,所有内容都会显示,但如果我尝试滚动,则没有任何反应.

我做错了什么?

iphone scroll uiscrollview

7
推荐指数
3
解决办法
1万
查看次数

标签 统计

iphone ×1

scroll ×1

uiscrollview ×1