How to make SeekBar take up full width of parent

后端 未结 4 2004
野性不改
野性不改 2021-02-08 00:55

I have a SeekBar in a RelativeLayout whose width is equal to the screen width.

I applied layout_width=\"match_parent\" to the

4条回答
  •  野的像风
    2021-02-08 01:40

    Before you post your xml,I guess that your RelativeLayout has lines as following

    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    

    This means your RelativeLayout do not fill up the screen,seekbar is fill up in its parent layout(RelativeLayout).So you can not get view you want.

提交回复
热议问题