In the development process, not every time through the storyboard drag control to complete the UI interface, because storyboard above the interface is "fixed dead", and sometimes may be in the process of running the program to dynamically add some new controls to the interface.
such as QQ chat information, is someone sent a message after the dynamic display.
So, you need to know how to dynamically add controls in code. In fact, the essence of storyboard is to turn to the corresponding code according to the graphical interface description.
Practice:
// Create a custom button UIButton *btn = [UIButton Buttonwithtype:uibuttontypecustom]; // [Btn setbackgroundimage:[uiimage imagenamed:@ " btn_01 " // [btn settitle:@ " dot me " Forstate:uicontrolstatenormal]; // [btn Settitlecolor:[uicolor Redcolor] forstate:uicontrolstatenormal];
A few lines of code can be used instead of the same effect as dragging and setting the control property in storyboard
Code for iOS base control to create controls without storyboard