There are two ways to customize a control: 1, pure code creation 2 through Xib custom controls
1. Xib Custom Controls (one xib can create multiple custom controls, but not generally)
1) First create a custom control class that inherits from the UIView Xib
Change the file name to be the same as the class name, drag a page of the same type as the class, and associate the class file.
Change the size of the custom view: Select UIView to change size after size is set to freeform
(Create attribute to. h file, associate event to. m file)
2) Add Xib custom Controls
#import "LoadingView.h"
Loadingview *lv= [ [[NSBundle Mainbundle]loadnibnamed:@ "Loadingview" owner: Self Options:Nil]Lastobject];
(Here [[nsbundle mainbundle]loadnibnamed:@ "Loadingview" owner: self options:nil] returns an array, Because you can create multiple controls at the same time in a xib, they are added sequentially to the array, but generally not .
2. Create custom controls in plain text
Lan Yi Education Record