-
Notifications
You must be signed in to change notification settings - Fork 258
Getting Started
FlexLib is a framework for creating native iOS applications using a human-readable markup language, similar to Android and .NET development way.
FlexLib is developed as freely open-source project on Github. You can get it through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'FlexLib'
Then import FlexLib.h in your project.pch:
#import <FlexLib/FlexLib.h>
@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