Skip to content

FlexLib Classes

zhenglibao edited this page Apr 10, 2024 · 9 revisions

FlexRootView

FlexRootView provide the core ability for layout, but you should not use it directly in most case. Instead you should use FlexCustomView、FlexFrameView、FlexXmlBaseView.

FlexBaseVC

It's base class for View Controller. For different device, you can override getSafeArea to provide different area.

FlexBaseTableCell

It's base class for table cell. The owner of cell layout is subclass of FlexBaseTableCell. You can bind variable or event.

FlexScrollView

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.

FlexTouchView & FlexTouchMaskView

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.

FlexTextView

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.

FlexModalView

By default, FlexModalView instance will hide after initial. You can call showModalInView to display it and hideModal to hide it.

FlexFrameView

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.

FlexCustomBaseView

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.

FlexXmlBaseView

与FlexCustomBaseView一样,该类也用来制作自定义的组件,所不同的是FlexXmlBaseView的派生类只能使用在xml中,其优点是与FlexCustomBaseView相比,FlexXmlBaseView具有更少的视图层级

FlexContainerView

You should use it as parent if you want to add or delete views dynamically. After add or delete subviews, you should call markDirty.

FlexCollectionView

It's almost same as UICollectionView. The only difference is init method. This class override init method to make it available in xml file.

Clone this wiki locally