如何在与其他视图相撞的地方修剪UIImageView
我有一条界线,可以浏览一些视图,并且应该在它们之间发生碰撞的地方有空间。我该怎么做?行是UIImageView,整个屏幕是Uiview类。
当然,我可以制作4个图像视图并相应地放置它们,但是我觉得有一种使其更漂亮的方法。
有关屏幕截图的更多信息,谢谢。
I have a line that goes through some views and should have spaces in places that collide between them. How can I do that? Line is a UIIMageView and the whole screen is a UIView class.
Of course, I can make 4 image views and place them accordingly, but I feel like there is a way to make it prettier.
More info on screenshot how it should be, thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是我长期使用的解决方案,没有图像:
stackView:horizontal:hixhtal and plosectal 。
我使用
InterfaceBuilder
仅逐步描述,因此我只会扩展所有subviews
,并通过在IB(InterfaceBuilder)上更改其名称来注意视图的大小,然后进行。屏幕截图将其连接起来。stackView
是出色的查看容器
,它减少了您的时间进行布局以进行限制甚至没有约束的情况。它允许您轻松地交换子视图的位置,而无需更改布局设置或需要再次执行布局。希望您可以解决问题。
Here is my solution for long-time usage, without image:
StackView: horizontal and fill with subView self-constrained.
I use
InterfaceBuilder
only it is hard to describe step by step so I just expand allsubViews
and note the size of views by changing its name on IB (InterfaceBuilder), then make a screenshot to attach it here.StackView
is one of greatView Container
that reduces your time to do layouts for views with constraints or even without constraints. It allows you can swap position of subviews easily without changing the layout setting or need to perform layouts again.Hope that you can solve your problem.