توی اندروید استودیوی 4 به بعد باتن پیش فرض باتن متریال دیزاین هست. بنابراین اگر برای کاستوم کردن باتن از روش قبلی استفاده کنیم یعنی shape بسازیم و با اتریبیوت background بدیم باتن تغییری نمیکنه. این روش برای باتن هایی که غیر متریال هستن جواب میده.
برای حل این مشکل دو راه هست:
1. استفاده از باتن غیر متریال و shape
این باتن توی XML اینجوری فراخونی میشه:
android.widget.Button
2. استفاده از باتن متریال و کاستوم کردن باتن به صورت زیر:
app:rippleColor: The colour to be used for the button ripple effect
app:backgroundTint: Used to apply a tint to the background of the button. If you wish to change the background color of the button, use this attribute instead of background.
app:strokeColor: The color to be used for the button stroke
app:strokeWidth: The width to be used for the button stroke
app:cornerRadius: Used to define the radius used for the corners of the button
منبع