GridView

open class GridView : UIView

网格视图

用于做九宫格布局,会将内部所有的 subview 根据指定的列数和行高,把每个 item(也即 subview) 拉伸到相同的大小。 支持在 item 和 item 之间显示分隔线,分隔线支持虚线。 注意分隔线是占位的,把 item 隔开,而不是盖在某个 item 上。

QMUI_iOS

  • 指定要显示的列数,默认为 0

    Declaration

    Swift

    @IBInspectable
    open var columnCount: Int
  • 指定每一行的高度,默认为 0

    Declaration

    Swift

    @IBInspectable
    open var rowHeight: CGFloat
  • 指定 item 之间的分隔线宽度,默认为 0

    Declaration

    Swift

    @IBInspectable
    open var separatorWidth: CGFloat { get set }
  • 指定 item 之间的分隔线颜色,默认为 UIColorSeparator

    Declaration

    Swift

    @IBInspectable
    open var separatorColor: UIColor? { get set }
  • item 之间的分隔线是否要用虚线显示,默认为 NO

    Declaration

    Swift

    @IBInspectable
    open var separatorDashed: Bool
  • 候选的初始化方法,亦可通过 initWithFrame:、init 来初始化。

    Declaration

    Swift

    public init(column: Int, rowHeight: CGFloat)
  • Undocumented

    Declaration

    Swift

    public override init(frame: CGRect)
  • Undocumented

    Declaration

    Swift

    public required init?(coder: NSCoder)
  • Undocumented

    Declaration

    Swift

    open override func sizeThatFits(_ size: CGSize) -> CGSize
  • Undocumented

    Declaration

    Swift

    open override var intrinsicContentSize: CGSize { get }
  • Undocumented

    Declaration

    Swift

    open override func layoutSubviews()