网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

详解Swift之clipped是什么如何用

clipped()函数介绍

创新互联主要从事网站设计制作、成都网站设计、网页设计、企业做网站、公司建网站等业务。立足成都服务中牟,十余年网站建设经验,价格优惠、服务专业,欢迎来电咨询建站服务:18980820575

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 SwiftUI

struct 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是什么如何用
文章出自:http://bjjierui.cn/article/ijjgjp.html

其他资讯