carlsq / flexboxlayout Goto Github PK
View Code? Open in Web Editor NEWiOS Flexbox Layout.
Home Page: http://cocoapods.org/pods/FlexBoxLayout
License: MIT License
iOS Flexbox Layout.
Home Page: http://cocoapods.org/pods/FlexBoxLayout
License: MIT License
FBLayout.m:
const CGSize sizeThatFits = [view sizeThatFits:(CGSize) {
.width = constrainedWidth,
.height = constrainedHeight,
}];
错误:-[UILabel sizeThatFits:] must be used from main thread only
可能是我使用的问题,望不甚解答,谢谢0.0
太长了,我用过FLEXBOX 还好说,但是对于他人,真的太长太不友好了
目前的cache完全是按NSIndexPath来的,在复杂列表里感觉不太方便,而且只关注contentView的出发点虽然好,但是需要对现有应用做比较大的侵入改造。
是否可以考虑像 https://github.com/forkingdog/UITableView-FDTemplateLayoutCell 一样做接口设计呢?
你好,我在使用FlexBoxLayout时发现了一个问题:
如果有两个以上的类都使用了FlexBoxLayout,
由于在fb_setCellContnetViewBlockForIndexPath这个方法中,设置了dispatch_once,导致只有第一个使用的类会调用
[self registerClass:[UITableViewCell class] forCellReuseIdentifier:kCellIdentifier];
这样会导致后面使用FlexBoxLayout的类产生崩溃
之后的类需要手动加入类似这样的代码可以避免崩溃:
[_myTableView registerClass:QMNoteFeedCardCell.class forCellReuseIdentifier:@"fb_kCellIdentifier"];
希望作者可以对这个问题优化一下,或者在使用说明中提示一下,谢谢
我是初始化时把所有子视图add到cell上了 然后用bool值来判断是否需要展开,
代码如下:
ps:这样写会崩
if (boll) {
// [_chartBgView fb_makeLayout:^(FBLayout *layout) {
// layout.margin.equalToEdgeInsets(UIEdgeInsetsMake(10, 0, 0, 0)).wrapContent();
// }];
// [_address fb_makeLayout:^(FBLayout *layout) {
// layout.margin.equalToEdgeInsets(UIEdgeInsetsMake(10, 0, 10, 0)).wrapContent();
// }];
[self fb_makeLayout:^(FBLayout *layout) {
layout.flexDirection.equalTo(@(FBFlexDirectionColumn)).margin.equalToEdgeInsets(UIEdgeInsetsMake(0, 12, 4, 12)).alignItems.equalTo(@(FBAlignFlexStart)).children(@[_titleLabel,div2]);
}];
}else{
[_chartBgView fb_makeLayout:^(FBLayout *layout) {
layout.margin.equalToEdgeInsets(UIEdgeInsetsMake(10, 0, 0, 0)).wrapContent();
}];
[_address fb_makeLayout:^(FBLayout *layout) {
layout.margin.equalToEdgeInsets(UIEdgeInsetsMake(10, 0, 10, 0)).wrapContent();
}];
[self fb_makeLayout:^(FBLayout *layout) {
layout.flexDirection.equalTo(@(FBFlexDirectionColumn)).margin.equalToEdgeInsets(UIEdgeInsetsMake(0, 12, 4, 12)).alignItems.equalTo(@(FBAlignFlexStart)).children(@[_titleLabel,div2,_chartBgView,_address]);
}];
}
项目里如果要同时引入YogaKit
和FlexBoxLayout
的话可以方便resolve confilct
看sample不太清楚应该何时调用wrapContent
这个方法?
对比了一下YogaKit
,它是rootView调用applyLayout
时调用YGNodeSetMeasureFunc
的,相对统一明确。
另外,它重写了intrinsicSize
方法,是否也可以参考加入一下?
这个布局 如果是像cell的imageView 加载比较慢的URL 会自动刷新dom树吗
rt
当前的链式语法不支持 Swift, 后续有打算支持 Swift 吗?
能给出下绝对布局的调用方法吗?
多谢~
typedef enum CSSFlexDirection {
CSSFlexDirectionColumn,
CSSFlexDirectionColumnReverse,
CSSFlexDirectionRow,
CSSFlexDirectionRowReverse,
CSSFlexDirectionCount,
} CSSFlexDirection;
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.