1. 首页
  2. 移动开发
  3. Android
  4. 瀑布流demo

瀑布流demo

上传者: 2018-12-27 15:13:40上传 RAR文件 2.42MB 热度 66次
public void setup() { containerLayout = new LinearLayout(getContext()); containerLayout.setBackgroundColor(Color.WHITE); LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT); addView(containerLayout, layoutParams); for (int i = 0; i < colCount; i++) { LinearLayout colLayout = new LinearLayout(getContext()); LinearLayout.LayoutParams colLayoutParams = new LinearLayout.LayoutParams( colWidth, LinearLayo ut.LayoutParams.WRAP_CONTENT); colLayout.setPadding(2, 2, 2, 2); colLayout.setOrientation(LinearLayout.VERTICAL); containerLayout.addView(colLayout, colLayoutParams); colLayoutArray.add(colLayout); } try { imageFilePaths = getContext().getAssets().list("images"); } catch (IOException e) { e.printStackTrace(); } addNextPageContent(true); } ut.LayoutParams.WRAP_CONTENT); colLayout.setPadding(2, 2, 2, 2); colLayout.setOrientation(LinearLayout.VERTICAL); containerLayout.addView(colLayout, colLayoutParams); colLayoutArray.add(colLayout); } try { imageFilePaths = getContext().getAssets().list("images"); } catch (IOException e) { e.printStackTrace(); } addNextPageContent(true); }
用户评论
码姐姐匿名网友 2018-12-27 15:13:40

不好改,不过能用