【问题标题】:Couldn't change the height and width of a layout无法更改布局的高度和宽度
【发布时间】:2017-05-20 14:05:10
【问题描述】:

在后台它被列为一个 constraintLayout ,我试图在它上面插入一个线性水平布局。每当我将 match_parent 分配给 android:layout_width 和 android:layout_height 时,它都会自动恢复为某个 Fixed Dp(例如宽度为 395dp,高度为 587dp)。如何更改此设置?

Screenshot Here

【问题讨论】:

  • 能否提供示例截图?
  • 那是我猜在附有问题的屏幕截图中

标签: android android-layout


【解决方案1】:

匹配父级在约束布局内不起作用,您必须在约束布局内定义相对位置。您必须分配 layout_constraintStart_toStartOf 和 layout_constraintEnd_toEndOf

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-03-31
    • 1970-01-01
    • 2020-01-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多