【问题标题】:Need advice with with a choice of layout需要有关布局选择的建议
【发布时间】:2014-11-21 19:29:34
【问题描述】:

我需要将视图设置为某种布局。视图将像LinearLayoutorientational="horizontal" 中的一个一个视图,如果没有位置,则最后一个视图将转到下一行。怎么可能?


Small screen    Bigger screen
| [][][] |      | [][][][] |
| [][][] |  ->  | [][][][] |
| [][][] |      | []       |

【问题讨论】:

    标签: android layout


    【解决方案1】:

    GridView 是要走的路。它将为您提供二维可滚动网格,您可以通过声明 numColumns 参数等于 auto_fit 来使其自动选择列数。

    【讨论】:

      【解决方案2】:

      在布局中使用 WeightSum 属性 & 在视图中使用 layout_Weight

      Check this link供参考

      【讨论】:

      • 我觉得这不是我想要的。
      猜你喜欢
      • 2011-05-30
      • 1970-01-01
      • 1970-01-01
      • 2020-08-13
      • 2010-10-21
      • 1970-01-01
      • 2016-05-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多