嘿人, 我有一些數據,並希望在導航堆棧內的新視圖中顯示。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
我安排了標籤和圖像。標籤的內容可能會有所不同,並且它們應該動態調整大小。我也在viewcontroller類中做了IBOutlets,並正確連接了所有東西。文件的所有者的觀點委託設置,查看..
然後我加載視圖 - 控制和我在「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];
}
當我啓動應用程序在我的模擬器中,一切都顯示,但如果我嘗試滾動,沒有任何反應。
我該怎麼做錯?
是什麼的視圖'幀大小3.1' ? – 2011-05-22 16:11:31
我在IB中設置大小爲320x1200 ..滾動視圖也在IB中設置爲320x1200 .. – dac 2011-05-22 16:24:32