代码之家  ›  专栏  ›  技术社区  ›  Saw Thinkar Nay Htoo Lavekush Agrawal

XCode中表格视图单元格中的自定义卡片视图设计

  •  2
  • Saw Thinkar Nay Htoo Lavekush Agrawal  · 技术社区  · 6 年前

    是否可以仅在情节提要的实用程序区域中创建支持交互的侧栏,或者是否需要任何自定义UI类?

    enter image description here

    相关问题: How to give shadow like card in iOS

    1 回复  |  直到 6 年前
        1
  •  6
  •   Lenin    6 年前

    试试这个

    像这样创建两个UIView

    enter image description here

     - Set corner radius to the backView
     - Set corner radius to the frontView, only for rightBottom and rightTop portions by using below method
    
    extension UIView {
    
    func roundCorners(_ corners: UIRectCorner, radius: CGFloat) {
        let path = UIBezierPath(roundedRect: self.bounds, byRoundingCorners: corners, cornerRadii: CGSize(width: radius, height: radius))
        let mask = CAShapeLayer()
        mask.path = path.cgPath
        self.layer.mask = mask
        }
    }
    

    参考我的代码 https://github.com/leninsmannath/CardViewSample.git