Swift中clipped如何使用-创新互联

这篇文章给大家介绍Swift中clipped如何使用,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。

让客户满意是我们工作的目标,不断超越客户的期望值来自于我们对这个行业的热爱。我们立志把好的技术通过有效、简单的方式提供给客户,将通过不懈努力成为客户在信息化领域值得信任、有价值的长期合作伙伴,公司提供的服务项目有:域名注册网站空间、营销软件、网站建设、鄄城网站维护、网站推广。

clipped()函数介绍

Clips the view to its bounding rectangular frame.

将View裁剪成矩形

By default, a view's bounding frame is used only for layout, so any content that extends beyond the edges of the frame is still visible. Use the clipped(antialiased:)modifier to hide any content that extends beyond these edges.

默认情况下,视图的边界框架仅用于布局,因此超出框架边缘的任何内容仍然可见。使用clipped(antialiased:)修饰器可以隐藏超出这些边缘的任何内容。

代码

import SwiftUIstruct ProductCard: View {  var body: some View {    VStack(alignment:.leading,spacing: 0){      Image("circle")        .resizable()        .scaledToFit()        .frame(minWidth:nil,            idealWidth: nil,            maxWidth: UIScreen.main.bounds.width,            minHeight: nil,            idealHeight: nil,            maxHeight: 300,            alignment: .center      )      .clipped()    }  }}

关于Swift中clipped如何使用就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。


文章题目:Swift中clipped如何使用-创新互联
转载来源:http://bzwzjz.com/article/ddiehh.html

其他资讯

Copyright © 2007-2020 广东宝晨空调科技有限公司 All Rights Reserved 粤ICP备2022107769号
友情链接: 响应式网站设计 H5网站制作 重庆网站建设 网站建设方案 成都网站设计公司 成都网站建设公司 营销网站建设 成都网站制作 网站制作 重庆企业网站建设 公司网站建设 成都定制网站建设 成都网站制作 企业网站设计 成都网站建设 成都网站建设 外贸网站建设 重庆网站设计 企业手机网站建设 成都网站设计公司 成都网站建设 成都网站设计