在单击某个段之前,UISegmentedControl 的初始加载不会执行任何操作?
我有一个 UISegmentedControl,其中每个段加载一个 UIScrollView。
由于某种原因,当视图最初加载时,第一段会突出显示,但滚动视图不会突出显示。为了加载它,我必须转到第 2 段,然后返回第 1 段...
有关如何解决此问题的任何想法吗?
I have a UISegmentedControl
where each segment loads a UIScrollView
.
For some reason, when the view is initially loaded, the first segment is highlighted but the scroll view is not. In order to load it I must go to segment 2 and then back to 1...
Any ideas on how to fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我猜测当控件设置初始状态时,您附加到分段控件的任何操作都不会被触发。当视图加载时,您可能必须手动调用该方法。
I'm guessing that whatever action you have attached to the segmented control doesn't get fired when the control has its initial state set. You'll probably have to call that method manually when the view loads.