While I was creating Calculator app same as installed in my S6 edge, I stuck when design buttons. I want to make buttons look exactly same as calc app which comes in all samsung phones.I tried state button pressed but they have design like fading colors in and out for seconds which I ain't sure how to create.
答案 0 :(得分:0)
以简单的方式创建名为 clickable_button.xml 的新xml文件 在里面写下这段代码
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/button_clicked" android:state_pressed="true"/>
<item android:drawable="@drawable/button"/>
</selector>
不要让两个可绘制的文件看起来被点击而另一个没有被点击
最后用clickable_button设置你的按钮背景;)