Child of RelativeLayout is not filling the height of the RelativeLayout

后端 未结 8 1719
终归单人心
终归单人心 2021-01-02 01:04

I have a ListView which gets populated with RelativeLayouts. The content of these RelativeLayouts can change and thus change their height respectively. On each RelativeLayou

相关标签:
8条回答
  • 2021-01-02 01:30

    If your RelativeLayout is inside a ScrollView, then on the ScrollView you need to add the fillViewPort param and set it to true

      <ScrollView
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:fillViewport="true">
    
    0 讨论(0)
  • 2021-01-02 01:30

    If you know the exact height you want to set, you can set Height or MinHeight for this component (View). In your case, you can set with: android:minHeight="76dp", or you can set it programmatically using LayoutParams. Hope it helps!

    0 讨论(0)
自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题