第三方开源库:流式布局:FlowLayout
2017-02-20 19:03
483 查看
FlowLayout
github:https://github.com/nex3z/FlowLayout使用的时候把子view添加到FlowLayout中。
flowLayout.addView(tv);
属性
属性 | 说明 |
---|---|
app:childSpacing=”auto” | 子布局的间隔 |
app:childSpacingForLastRow=”align” | 最后一行子布局 |
app:rowSpacing=”8dp” | 行间距 |
app:rtl=”true” |
xml:
<com.nex3z.flowlayout.FlowLayout android:id="@+id/flowLayout" android:layout_width="match_parent" android:layout_height="wrap_content" app:childSpacing="auto" app:childSpacingForLastRow="align" app:rowSpacing="8dp" app:rtl="true"/>
Java
flowLayout = (FlowLayout) findViewById(R.id.flowLayout); array = getResources().getStringArray(R.array.lorem_ipsum); for (int i = 0; i < array.length; i++) { TextView tv = new TextView(this); tv.setText(array[i]); tv.setTextSize(TypedValue.COMPLEX_UNIT_SP,16); tv.setPadding(30,10,30,10); tv.setBackgroundResource(R.drawable.tv_bg_shape); flowLayout.addView(tv); }
相关文章推荐
- 我可能使用假的流式布局。自定义XFlowLayout
- JavaSwing_1.1: FlowLayout(流式布局)
- Java图形化界面设计——布局管理器之FlowLayout(流式布局)
- 流式布局FlowLayout
- Android 流式布局FlowLayout
- [黑马] -- 第1天 Swing界面---流式布局FlowLayout
- 流式布局FlowLayout及行数限制
- 三、Java图形化界面设计——布局管理器之FlowLayout(流式布局)
- Java图形化界面设计——布局管理器之FlowLayout(流式布局)
- Android自定义流式布局-FlowLayout
- 100行Android代码自定义一个流式布局-FlowLayout
- 流式布局FlowLayout以及动态添加Item的实现
- Android自定义控件--流式布局(FlowLayout)--自动适配
- 自定义FlowLayout(流式布局)
- Java图形化界面设计——布局管理器之FlowLayout(流式布局)
- AutoFlowLayout:多功能流式布局与网格布局控件
- FlowLayout实现自定义的流式布局
- UI一揽子计划 21 (UICollectionView、SDWebImage第三方类库加载图片的使用、集合视图的布局UICollectionViewFlowLayout 、自定义Cell、布局协议
- 跟我学JAVA(5)图形化界面设计——布局管理器之FlowLayout(流式布局)
- 自定义ViewGroup,流式布局FlowLayout