Text Markup Language is used for layout. The most commonly used HTML language is used. HTML can be understood as a set of XML languages with special tags.
I. How xib and storyboard are displayed in iOS
In iOS, there are three main interface layout Methods: code, xib, and storyboard.
1. Code
The Code layout interface is omnipotent, but usually complicated. Setting up a simple interface may require a lot of lines of code, so it is very cumbersome.
The following code creates a button. At least three lines are required:
UIButton *btn = [UIButton buttonWithType:UIButtonTypeContactAdd]; btn.center = CGPointMake(100, 100); [self.view addSubview:btn];
2. xib
Xib is suitable for layout of small-sized interfaces and can also be used as a single interface. It is a drag-and-control type. You only need to write the code for loading xib.
To open the xib file in a text editor:
Vc/screens + PC9wPgo8cD7Qzsjno7o8L3A + labels = "brush: java;"> UIView * view = [[UIView alloc] init]; view. frame = CGRectMake (0.0, 0.0, 320,480 );
3. storyboard
Storyboard is suitable for large page jumps, and the rich viewController makes it easy to reduce and reduce.
Similarly, open the storyboard in a text editor. You can see the following:
Comparison of layout display between Android and iOS
As we all know, the layout in Android is basically completed in xml. Even if there is a so-called place where the controls can be dragged, it can only be roughly constructed.
IOS encapsulation is excellent. If you do not need to open it in a text editor, many may not know that this layout is displayed using an xml file.
Basic Principles: The basic layout and display principles of Android and iOS are the same. Views and model data are separated and all follow the MVC design pattern.
Reprinted please indicate the source: http://blog.csdn.net/xn4545945