我有一個帶有一些視圖的ScrollView。我在點擊按鈕時隱藏了一些元素。我的問題是,滾動視圖跳轉到頂部(0,0)重置scrollview的contentize。我設置了滾動內容大小如下:ScrollView在setContentSize後跳轉到頂部
if(![subview isHidden]){
scrollViewHeight += subViewFrame.size.height;
}
[scrollView setContentSize:(CGSizeMake(320, scrollViewHeight + 20))];
檢查scrollViewHeight – Tendulkar 2013-05-06 11:20:44