# FlowLayoutDemo **Repository Path**: zhouzhou/FlowLayoutDemo ## Basic Information - **Project Name**: FlowLayoutDemo - **Description**: 水平的流布局,基于FrameLayout改造的,可以在布局或者代码中addview.也可以用Adapter填充子View. 具体的看代码吧 - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2014-06-11 - **Last Updated**: 2024-05-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README FlowLayout a flowlayout which can be place one by one . ### Horizontal flow layout, based on the FrameLayout transformation, can addview in layout or code. The Adapter is also used for filling the View. ![Screen](/S40528-092812.jpg) *** ### add view by code: ```java FlowFrameLayout flowLayout = (FlowFrameLayout) root.findViewById(R.id.flow_layout); Random r = new Random(13); for (int i = 0; i < 20; i++) { int len = r.nextInt(10); String s = generateString(r, characters, len); s = s + " " + i + " "; TextView text = new TextView(getActivity()); text.setText(s); text.setTextSize(20); text.setBackgroundColor(Color.DKGRAY); flowLayout.setupChild(text, i); } flowLayout.requestLayout(); ``` ### or use code: ```java mFlowLayout = (FlowFrameLayout) findViewById(R.id.flow_list); mFlowLayout.setMaxLines(4); mFlowLayout.setOnItemClickListener(this); mFlowLayout.setAdapter(myAdapter); ```