简体   繁体   English

当我垂直向下滚动时,scrollView Resets是位置

[英]The scrollView Resets is position when i scroll down vertically

When i try to scroll down the content , it just resets his position , i want to scrolldown and the position stay where i want , can someone please help me know , what i am missing? 当我尝试向下滚动内容时,它只是重置了他的位置,我想向下滚动并将位置保持在我想要的位置,请有人帮我知道,我想念的是什么?

scrollview 滚动视图

ScrollView故事板

It seems you are using layouts for scrollview. 看来您正在使用布局的scrollview。 Scrollview will not know its content size unless contentSize or intrinsicSize are setted. 除非设置了contentSize或nativeSize,否则Scrollview将不知道其内容大小。

This would result in the bouncy effect which lets user peek into and returns to original position when lifted the finger. 这将导致弹性效果,使用户在抬起手指时可以窥视并返回到原始位置。

If le is the last element in the scrollview then in your viewDidLoad add 如果le是滚动视图中的最后一个元素,则在您的viewDidLoad中添加

scrollView.contentSize=CGSizeMake(self.view.frame.size.width,le.frame.size.height+le.frame.orizin.y);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM