Tengo problemas para aplicar un degradado de fondo a LinearLayout.Android LinearLayout Gradient Background
Esto debería ser relativamente simple por lo que he leído, pero parece que no funciona. Como referencia, estoy desarrollando 2.1-update1.
header_bg.xml:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="90"
android:startColor="#FFFF0000"
android:endColor="#FF00FF00"
android:type="linear"/>
</shape>
main_header.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="50dip"
android:orientation="horizontal"
android:background="@drawable/header_bg">
</LinearLayout>
Si cambio @ estirable/header_bg a un color - por ejemplo, # FF0000 funciona perfectamente bien. ¿Me estoy perdiendo algo obvio aquí?
androide: backgroundTint androide: backgroundTintMode http://stackoverflow.com/a/43341289/3209132 –