How to use Android GradientDrawable

前端 未结 1 405
隐瞒了意图╮
隐瞒了意图╮ 2021-02-11 17:23

I try to use the GradientDrawable to set a gradient to some backgrounds and buttons. Sadly the documentation is not very detailed.

What are the main attributes to conf

相关标签:
1条回答
  • 2021-02-11 17:42

    use this xml as background to the imageview.

    <?xml version="1.0" encoding="utf-8"?>
    <shape xmlns:android="http://schemas.android.com/apk/res/android">
    <gradient android:angle="90" android:startColor="#7c0000" android:endColor="#A71C1C"/>
    </shape>
    

    thats it.

    0 讨论(0)
提交回复
热议问题