iOS 卡片视图:MaterialCardView

ybw8 7年前

MaterialCardView 可以简单快捷地创建Material设计卡片。

Usage

Create aMaterialCardView

    let c = MaterialCardView (                     x: 10,                     y: StatusBarHeight + 10,                     w: ScreenWidth-20)        view.addSubview (c)

And start to addMaterialCardCells

  • Header Cell
    func addHeader (title: String) func addHeader (view: UIView)
  • Cell
    addCell (text: String, action: (()->Void)? = nil)      addCell (view: UIView, action: (()->Void)? = nil)      addCell (cell: MaterialCardCell)
  • FooterCell
    func addFooter (title: String) func addFooter (view: UIView)

Material Card will update its frame size when you add or removeMaterialCardCells.
This is why you don't set itsheightvalue when initilize it.

样本:

iOS 卡片视图:MaterialCardView

项目主页:http://www.open-open.com/lib/view/home/1433401476416