慕村225694
最简单的解决方案第1步:使用最新的支持库compile 'com.android.support:appcompat-v7:25.2.0'第2步:使用AppCompatActivity作为父Activity类public class MainActivity extends AppCompatActivity第3步:在布局XML文件中使用app命名空间
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">第4步:使用AppCompatButton而不是Button
android:id="@+id/buttonAwesome"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Awesome Button"
android:textColor="@color/whatever_text_color_you_want"
app:backgroundTint="@color/whatever_background_color_you_want"/>