uiedgeinsets专题

iOS - UIButton(UIEdgeInsets)/设置button上的文字和图片上下垂直居中对齐

UIEdgeInsets [objc]  typedef struct UIEdgeInsets {   CGFloat top, left, bottom, right;  // specify amount to inset (positive) for each of the edges. values can be negative to 'outset'   }

理解UIEdgeInsets

iOS 的控件,只看到  UIButton 可以设置Padding/Insets,即按钮上文字或图片与按钮边界的间隙,对与 CSS 来说叫做Padding,在 iOS 中叫做 Insets,UIButton 设置 Insets 相应的属性如下: Configuring Edge Insets      contentEdgeInsets  property      titleEdgeI