Drawable shape not showing when used in combination with android:drawableBottom attribute.

后端 未结 2 1947
遇见更好的自我
遇见更好的自我 2020-12-15 08:46

XML file saved at res/drawable/gradient_box.xml:




        
2条回答
  •  难免孤独
    2020-12-15 08:57

    If you are using an ImageView to host the line shape as part of the "android:src" attribute, you will also run into the same problem unless you specify the width and height as part of the shape xml. One workaround is to host the line shape as part of the "android:background" attribute of ImageView. This way, you can make use of the size attributes of the ImageView for the line shape to "show" through.

提交回复
热议问题