在 UIView 中绘制以及 addSubview
你好 我想使用 Interface Builder 在 UIView 上添加两个按钮,并在这两个按钮之间画一条线。这怎么可能?请建议。谢谢
Hi
I want add two buttons on a UIView using Interface Builder, and draw a line between these two buttons. How is this possible? Please suggest. Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不使用drawrect的一个简单选择是在两个按钮之间放置一个薄的UIView。将视图的背景颜色设置为您想要的线条颜色。
编辑:
您仍然可以使用精简 UIView 并根据需要切换其可见性。
如果您仍然想绘制线条,您可能需要创建一个自定义 UIView。
A simple option without using drawrect is to just put a thin UIView between the two buttons. Set the view's background color to the line color you want.
Edit:
You could still use thin UIViews and toggle their visibility as needed.
If you still want to draw the lines, you might want to create a custom UIView.