Programmatically setting LinearLayout divider size

前端 未结 1 1580
眼角桃花
眼角桃花 2021-01-27 12:15

I have tried multiple solutions to this but none seem to work! I am currently using the following Drawable as a divider (this is the horizontal example but the same

相关标签:
1条回答
  • 2021-01-27 12:47

    your drawable height is 0. try the following:

    <shape xmlns:android="http://schemas.android.com/apk/res/android">
        <size
            android:width="10dp"
            android:height="10dp" />
         <!--android:height depends on the height you want for the horizontal line--->
    </shape>
    

    or add:

    drawable.setIntrinsicHeight(height);
    
    0 讨论(0)
提交回复
热议问题