/Viewwithtag: Pass a tag value, view will find the corresponding view according to the tag value
UILabel *label = [Self.view viewwithtag:10];
Once the Addsubview is executed: The time is equal to self. View has a strong pointer to the view being added
[Self.view Addsubview:button];
Use the weak modifier later when defining UI control properties
@property (nonatomic, weak) UIButton *button;
Instantiating a button
UIButton *button = [[UIButton alloc] initwithframe:cgrectmake (100, 100, 200, 200)];
Assign a value to a global property
Self.button = button;
/**
The nature of property
Set method
Get method
_ Property Name
*/
I. Transform properties, making deformation
Translation:
Cgaffinetransformmaketranslation (10, 0): Panning based on the initial position
Cgaffinetransformtranslate (Self.redView.transform, 10, 0) can take effect multiple times, based on the current state
Rotating:
Cgaffinetransformmakerotation:angle: Is Radian
M_pi_4:45°
If the pass value is negative: rotate counterclockwise
Cgaffinetransformmakerotation (M_pi_4)
Cgaffinetransformrotate (Self.redView.transform,-m_pi_4)
Scaling:
Cgaffinetransformmakescale (1.2, 1.2): 1.2 times magnification on x-axis, 1.2 times magnification on y-axis
If you want to zoom out, pass a value less than 1, and if you pass it as a negative, the view is insane.
Cgaffinetransformmakescale (1.2, 1.2)
Cgaffinetransformscale (Self.redView.transform, 0.8, 0.5)
When the transform of the view changes, it affects the frame, so if you animate, use bounds and center instead.
Animatable. Don't use frame if view is transformed since it won't correctly reflect the actual location of the view. Use bounds + Center instead
Ios-ui-transform