-
Notifications
You must be signed in to change notification settings - Fork 257
Tutorial 1: Create View Controller with xml layout
zhenglibao edited this page Jan 13, 2018
·
1 revision
@interface HelloWordVC : FlexBaseVC
@end
@implementation HelloWordVC
- (void)viewDidLoad {
[super viewDidLoad];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
@end
Notice: you need to write nothing. Just derive it from FlexBaseVC will work.
The name 'HelloWordVC' is not necessary, but it will simplify to init the view controller.
This file looks:
<?xml version="1.0" encoding="utf-8"?>
<UIView layout="flex:1,justifyContent:center,alignItems:center" attr="bgColor:white">
<UILabel attr="fontSize:16,color:#333333,text:helloWord"/>
</UIView>
HelloWordVC* vc = [[HelloWord alloc]init];
[navigationController pushViewController:vc animated:YES];
Flexbox Introduction & performance (in Chinese)
Tutorial 1: Create View Controller with xml layout
Tutorial 2: Create Table Cell with xml layout
Tutorial 3: Embed xml layout into traditional view hierarchy
Tutorial 4: Use custom view in xml layout
Tutorial 5: Create reusable view using xml layout file