iOS视图封装 - UIViewPadding

UIViewPadding

Build Status

UIView的子类控件的Padding

image

功能

  1. UILabel的padding
  2. UITextField的padding
  3. UIButton/UIScrollView的padding的设置
  4. 适用于Storyboard

用法

1.Storyboard

2.代码创建

        let sslabel = SSLabelPadding()
        sslabel.paddingLeft = 10
        sslabel.paddingLeft = 10
        sslabel.paddingLeft = 10
        sslabel.paddingLeft = 10
        
        let ssTextField = SSTextFieldPadding()
        ssTextField.insetX = 10
        ssTextField.insetY = 10
        
        ssButton.contentEdgeInsets = UIEdgeInsets(top: 10, left: 10, bottom: 10, right: 10)
        
        //UIScrollView类的控件
        ssTextView.contentInset = UIEdgeInsets(top: 10, left: 10, bottom: 10, right: 10)

你可能感兴趣的:(iOS视图封装 - UIViewPadding)