Skip to content

Tutorial 3: Embed xml layout into traditional view hierarchy

zhenglibao edited this page Jan 13, 2018 · 1 revision

Write xml layout file

Use FlexFrameView to load it.

    CGRect rcFrame = CGRectMake(0, 0, [[UIScreen mainScreen] bounds].size.width, 0);
    FlexFrameView* header = [[FlexFrameView alloc]initWithFlex:@"TableHeader" Frame:rcFrame Owner:self];
    header.flexibleHeight = YES;
    [header layoutIfNeeded];
    
    _table.tableHeaderView = header;

You can set fixed frame to it or make it flexible.

If the view is flexible, you can get notification with onFrameChange block when the view size changed.

Clone this wiki locally