在新的AppCompat库中,我们可以通过这种方式对按钮进行着色:
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/follow"
android:id="@+id/button_follow"
android:backgroundTint="@color/blue_100"
/>
Run Code Online (Sandbox Code Playgroud)
如何在我的代码中以编程方式设置按钮的色调?我基本上试图根据一些用户输入实现按钮的条件着色.