Four easy-to-confuse attributes
1, TextAlignment: The horizontal direction of the text alignment method
1> value
Nstextalignmentleft
Nstextalignmentcenter
Nstextalignmentright
2> which controls have this property: A control that is generally capable of displaying text has this property
Uitextfield
UILabel
Uitextview
2.ContentVerticalAlignment: Vertical alignment of content
1> value
Uicontrolcontentverticalalignmentcenter
Uicontrolcontentverticalalignmenttop
Uicontrolcontentverticalalignmentbottom
2> which controls have this property: A control that inherits to Uicontrol or Uicontrol itself
Uicontrol
UIButton
Uitextfield ...
3.contentHorizontalAlignment: Horizontal alignment of content
1> value
Uicontrolcontenthorizontalalignmentcenter
Uicontrolcontenthorizontalalignmentleft
Uicontrolcontenthorizontalalignmentright
2> which controls have this property: A control that inherits to Uicontrol or Uicontrol itself
Uicontrol
UIButton
Uitextfield ...
4.contentMode: Content Mode (controls how content is aligned), generally useful for uiimageview
1> value
Uiviewcontentmodescaletofill: Stretches the picture to fill the entire Uiimageview
Uiviewcontentmodescaleaspectfit: Stretch to fit the entire Uiimageview according to the image's original aspect ratio
Uiviewcontentmodescaleaspectfill: Stretch to the width of the image as the width of the uiimageview, or the height of the image to the height of the Uiimageview, as the picture's original aspect ratio is stretched.
Uiviewcontentmoderedraw: When the size of the control changes, it is redrawn once (call Setneeddisplay again, call DrawRect)
Uiviewcontentmodecenter
Uiviewcontentmodetop
Uiviewcontentmodebottom
Uiviewcontentmodeleft
Uiviewcontentmoderight
Uiviewcontentmodetopleft
Uiviewcontentmodetopright
Uiviewcontentmodebottomleft
Uiviewcontentmodebottomright
2> which controls have this property: All UI controls have