iPhone动态滚动视图的问题
我在网上寻找我的问题的答案,但没有成功。我正在使用带有 3 个按钮的工具栏的视图。在一个视图中是一个滚动视图。每当我点击其中一个按钮时,滚动视图就会填充许多具有动态大小和位置的标签和文本视图。取决于解析的文本量。滚动视图的大小(高度)也会根据其子视图的大小动态变化。当我只需切换工具栏按钮而无需事先滚动视图时,一切都很好。但是,如果我将视图滚动到底部,然后通过单击按钮更改文本和标签的位置和大小,滚动视图会表现得很奇怪,并且不会返回到其先前的位置(内容偏移 0, 0)。我想知道是否有一个好的 waz 可以使这项工作更加顺利。谢谢!
I was looking for an answer to my problem all over the net but with no succes. I am using a view with a toolbar with 3 buttons. In a view is a scrollview. Whenever i tap one of the buttons, scrollview is populated with a number of labels and textviews with dynamic size and position. depending on the ammount of text that was parsed. The size of scroll view (height) is also dynamicly changed depending on the size of its subviews. It all works good when i just switch toolbar buttons without previously scrolling the view. But if i scroll a view to the bottom, and then by clicking button i change positions and size of text and labels, the scrollview is acting strange and is not returning to its previous position (content offset 0, 0). I was wondering if there is a good waz to make this work more smootly. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为什么不简单地在设置滚动视图的新内容的同时设置其 contentOffset ,即
Why don't you simply set the contentOffset of the scroll view at the same time you are settings its new content, i.e.