在 iPhone SDK 中将 UIButton 从 UIScrollView 移动到 UIView
我遇到了一个问题,实际上场景在我的视图控制器中是这样的,我放置了几个按钮,我可以在视图中移动它们,现在在同一个视图中,一半的屏幕被这个滚动视图中的 uiscrollview 占据,我也有几个 uibuttons,我想要从 uiscrollview 移动到 uiview 现在,当我尝试将 uibutton 从 uiscrollview 移动到 uiview 时,它会在从滚动视图移动时隐藏,就像我将 uibutton 从 uiview 移动到 uiscrollview 一样,然后当我的拖动到达滚动视图区域时它也会隐藏。
请帮我解决这个问题
提前谢谢......
I am stuck with a problem actually the scene is like this in my view controller i have place several buttons which i can move within the view now in same view half of the screens is occupied by uiscrollview in this scrollview also i have several uibuttons which i want to move from uiscrollview to uiview Now when i try to move uibutton from uiscrollview to uiview it hides as it moves from the scrollview similarly as i move uibutton from uiview to uiscrollview then also it hides as my drag reaches the scrollview area.
Please help me out with this problem
Thanks in advance....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
每个 UIButton 都有一个超级视图。对于滚动视图中的 UIButtons,UIScrollView 是超级视图。当你有scrollView.clipsToBounds == YES时,如果你将滚动视图中的UIButtons移到滚动视图的可见区域之外,它们将变得模糊。
有几种可能的解决方案,包括:
Your UIButtons each have a superview. For the UIButtons in the scrollview, the UIScrollView is the superview. When you have scrollView.clipsToBounds == YES, then the UIButtons in the scrollview will become obscured if you move them outside of the visible area of the scrollview.
There are several possible solutions, including: