A. UIView1. Concept belonging to Uikit framework what can be seen and touched on the screen is UIView, such as buttons on the screen, text, images translation: View/controls/Components uibutton, uilable, Uitextfield all inherit from uiview each uiview is a container that can accommodate other uiview 2. Parent and child controls parent control: uiview child controls that hold other UIView: Uiview b are placed in another uiview. UIViewController1. Concepts Things to control UIView when a new interface is displayed, A new Uiviewcontroller is created first, and the corresponding Uiview,uiviewcontroller is created by Uiviewcontroller to manage this uiview uiviewcontroller is UIView's big housekeeper, responsible for UIView creation, display, operation, destruction, responsible for monitoring the internal events of UIView, responsible for handling UIView user interaction uiviewcontroller has a UIView attribute inside it, which is its responsible UIView object c. Control and Uiviewcontroller Connection 1.IBAction (1) can ensure that the method line (2) is equivalent to void 2.iboutlet (1) To ensure the attribute line 3. uitextfield (1) Set the keyboard type, control the input data classType (e.g. numeric keypad, can only enter numbers) 4.company Identifier & bundle identifier company Identifier + app name = Bundle Id entifier bundle identifier is the app's unique identity 5. Exit the keyboard who called out, Who drives 1. //exit keyboard //First responder, the software that called the keyboard //Remove the first responder individually [Self.num1 resignfirstresponder]; [self.num2 resignfirstresponder]; 2. Bring your own method [Self.view Endediting:yes]; the condition is that the keyboard is a c that is called by the controls inside the Self.view. private extension Write extensions in. m files, but no extension #import "ViewController.h" @interface Viewcontroller () @end
@implementation viewcontroller@end Private extensions can define variables, and the variables and methods in the private extension are private D. Wired controls, methods best placed in. m files, remain encapsulated E. Control Common Properties Superview parent control subviews child control tag identity transform deformed frame position dimensions: Bounds position dimensions in the upper-left corner of the parent control: Position information for the control's rectangle, with its own upper-left corner as the origin, and generally (0,0) center midpoint: The upper-left corner of the parent control is the origin point
[iOS base Control-1] UI Concepts