問(wèn)題描述
我的自動(dòng)布局(可能)和我的滾動(dòng)視圖有問(wèn)題!
I have a problem with autolayout(maybe) and my scrollview!
我的問(wèn)題
- 我向下滾動(dòng)
2.然后我推送到另一個(gè)視圖
2.Then I push to another View
3.然后我回去,滾動(dòng)視圖看起來(lái)像那樣,我無(wú)法滾動(dòng)到最高點(diǎn).(我在滾動(dòng)視圖的彈跳中看到它)
3.Then I go back and the scrollview looks like that and I'm not able to scroll to the highest point.(I see it in the bouncing of the scrollview)
誰(shuí)能幫幫我?
推薦答案
包含視圖控制器中的以下代碼片段似乎也解決了這個(gè)問(wèn)題,而不依賴于顯式大小:
The following code snippet in the containing view controller also seems to solve the problem, without relying on explicit sizes:
- (void)viewDidDisappear:(BOOL)animated {
[super viewDidDisappear:animated];
self.mainScrollView.contentOffset = CGPointZero;
}
它確實(shí)將內(nèi)容偏移量重置為原點(diǎn),但其他答案似乎也是如此.
It does reset the content offset to the origin, but it seems that so do the other answers.
這篇關(guān)于UIScrollview 自動(dòng)布局問(wèn)題的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!