The backgroundTint
is correctly applied on API 23, but not on API 19. How can I get the drawable tinted for API 19 and below?
<Button
android:layout_width="40dp"
android:layout_height="40dp"
android:id="@+id/AbResetBtn"
android:background="@android:drawable/stat_notify_sync"
android:backgroundTint="@color/button_material_light" />
Of course my Activity
extends AppCompatActivity
.
This worked for me on API19 device, support lib v7
layout
<Button
android:id="@id/btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/label"
style="@style/Button"
/>
styles
<style name="Button" parent="Base.TextAppearance.AppCompat.Button" >
<item name="backgroundTint">@color/fab_bg</item>
</style>
I know its little bit old question but you don't need to create a style element even.
Just use AppCompatButton from the support library with app: namespace.
<android.support.v7.widget.AppCompatButton android:layout_width="40dp"
android:layout_height="40dp"
android:id="@+id/AbResetBtn"
android:background="@android:drawable/stat_notify_sync"
app:backgroundTint="@color/button_material_light" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With