-
Notifications
You must be signed in to change notification settings - Fork 257
FlexLib Classes
FlexRootView provide the core ability for layout, but you should not use it directly in most case. Instead you should use FlexCustomView、FlexFrameView、FlexXmlBaseView.
It's base class for View Controller. For different device, you can override getSafeArea to provide different area.
It's base class for table cell. The owner of cell layout is subclass of FlexBaseTableCell. You can bind variable or event.
It's replacement for UIScrollView. The main goal is to calculate the content size automatically. The layout will change automatically when change subview's text, hidden, attributedText. Otherwise you need call markDirty if you change other view attribute.
It's replacement for UIButton. You can still use UIButton, but FlexTouchView is more powerful. You can set underlayColor & activeOpacity to change the appearance when pressed.
It's replacement for UITextView. This control will adjust it's frame when input new text. You can set minHeight & maxHeight to limit its height.
By default, FlexModalView instance will hide after initial. You can call showModalInView to display it and hideModal to hide it.
If you want to add xml layout view to traditional view, FlexFrameView is good for you. This class doesn't use flexbox layout. Instead it maintain a flexbox child view and give you an easy interface.
This class is designed for writing custom views with layout file. You should derive class from it and override getFlexName & onInit, create xml layout file and other extension. Then you can use this custom class in layout file.
与FlexCustomBaseView一样,该类也用来制作自定义的组件,所不同的是FlexXmlBaseView的派生类只能使用在xml中,其优点是与FlexCustomBaseView相比,FlexXmlBaseView具有更少的视图层级
You should use it as parent if you want to add or delete views dynamically. After add or delete subviews, you should call markDirty.
It's almost same as UICollectionView. The only difference is init method. This class override init method to make it available in xml file.
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