2012-11-01 33 views
1

在我的應用程序我有一個的UIScrollView(在水平滾動模式),並且當用戶點擊該按鈕的視圖的卡扣將在滾動視圖爲的UIImageView添加一個按鈕,我有這樣的使用進行,自動滾動的UIScrollView其內容位置

UIGraphicsBeginImageContext(storyCreateView.frame.size); 
CGContextRef context = UIGraphicsGetCurrentContext(); 

[storyCreateView.layer renderInContext:context]; 


UIImage *screenShot = UIGraphicsGetImageFromCurrentImageContext(); 
UIGraphicsEndImageContext(); 


newscene.image=screenShot; 
[galleryView addSubview:newscene]; 

當用戶增加了更多的圖像的圖像在滾動視圖隱藏我想自動滾動到右側,讓用戶可以看到他的最後添加的圖像。

回答

1

您可以使用setContentOffset:animated:。它集從對應於接收器的起源內容視圖的原點的位置偏移。

希望它爲你工作。