【问题标题】:How to adjust child view height after resizing its parent ViewGroup?调整其父 ViewGroup 的大小后如何调整子视图高度?
【发布时间】:2012-12-12 14:40:23
【问题描述】:

我有自定义视图,它扩展了RelativeLayout,并有height 设置为“fill_parent”的子元素。 问题是调整父母的身高不会影响其孩子的身高。 我怎样才能强迫孩子适应它的父母?

【问题讨论】:

    标签: java android android-custom-view


    【解决方案1】:

    您可以使用 LayoutParams 以编程方式更改高度\宽度,请检查: How to create a RelativeLayout programmatically with two buttons one on top of the other?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-09-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多