我在ScrollView
中有一個ImageView
,並在某個時間調整了ScrollView
的大小。問題是,ImageView
調整爲與ScrollView
相同的大小,但我希望它保持原始圖像大小。Scrollview中的圖像大小調整
我在做什麼,這是:
scrollView.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height); // fullscreen scrollview
[scrollView setContentMode:UIViewContentModeTopLeft]; //i want the content to be on the top left, thats correct right?
[scrollView setContentSize:CGSizeMake(imageInScrollView.frame.size.width, imageInScrollView.frame.size.height)]; // now im setting the size of the content, which is like 200x200 but it shows in fullscreen
請閱讀我旁邊的代碼中的註釋,謝謝!
加入這一行我的代碼,但它什麼也沒做 – oybcs 2012-07-24 09:19:35