【问题标题】:LinearLayout with full width Android具有全宽 Android 的 LinearLayout
【发布时间】:2015-06-30 09:01:44
【问题描述】:

现在我的应用布局看起来像this

我希望它看起来像 this

我怎样才能做到这一点?我使用 LinearLayout 作为 ScrollView 的子级。

【问题讨论】:

  • 使您的布局宽度=包装内容以匹配父项
  • 检查滚动视图和线性布局的边距、填充并根据您的要求进行调整

标签: android scrollview android-linearlayout


【解决方案1】:

在 LinearLayout 标签内添加属性, layout_width: "match_parent",像这样,

<LinearLayout>
layout_width: "match_parent"
</LinearLayout> 

【讨论】:

    【解决方案2】:

    很简单。

    将白框的layout_width属性设置为match_parent

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-11-08
      • 1970-01-01
      • 2011-10-26
      • 2016-11-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多