Comments (1)
xml布局中不支持for循环语句,但可以在代码中动态添加flex视图,如下
UILabel* label=[UILabel new];
[label enableFlexLayout:YES]; //这句很重要
[label setLayoutAttrStrings:@[
@"width",@"60",
@"margin",@"2",
@"height",@"40",
@"alignItems",@"center",
@"justifyContent",@"center",
]];
[label setViewAttrStrings:@[
@"fontSize",@"16",
@"color",@"red",
@"text",@"删除",
]];
[self addSubview:label];
from flexlib.
Related Issues (20)
- 如果能提供数据和界面之间的绑定,就再好不过 HOT 5
- 一点小建议 HOT 5
- 支不支持动画? HOT 1
- stickTop:true无效,官方demo也没有任何效果 HOT 3
- 喜欢flex布局的便捷,和Texture框架比较怎么选择? HOT 9
- 转义字符好像玩不转 HOT 1
- how to user Macro FLEXSET in swift HOT 2
- 预览模块如何只在 debug 下使用 HOT 4
- 如何在自定义的宏中添加参数,然后用在 xml 里 HOT 3
- 自定义宏,不管用 HOT 4
- 控件平移等动画
- 样式 class 的使用
- 请问如何使用xml进行App主题颜色的适配?
- xml文件里,第一次触摸到 UITextField 后,就滑动不了了。 HOT 2
- FlexShowToast有时好使,有时不好使 HOT 2
- pod 问题。。 HOT 1
- 热加载 HOT 1
- FlexLib 做阿拉伯适配 . 设置 direction:rtl . 无效呢
- Xcode14.3 报错 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flexlib.