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

Saw*_*too 2 tableview ios swift

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

在此处输入图片说明

相关问题:如何在 iOS 中提供类似卡片的阴影

小智 6

尝试这个

像这样创建两个 UIView

在此处输入图片说明

 - 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
    }
}
Run Code Online (Sandbox Code Playgroud)

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