Button 点击跳转界面,但有时点击且跳转界面了,但是点击效果没有出现。。??为什么???下面是我为Button 设置的点击状态效果。。??求解答???
<selector
xmlns:android="http://schemas.android.com/apk/res/android"
>
<item
android:state_pressed="false"
android:drawable="@drawable/tb_homepage_ff_up"
/>
<item
android:state_pressed="true"
android:drawable="@drawable/tb_homepage_ff_down"
/>
<!-- android:state_pressed="true" -->
</selector>
<selector
xmlns:android="http://schemas.android.com/apk/res/android"
>
<item
android:state_pressed="false"
android:drawable="@drawable/tb_homepage_ff_up"
/>
<item
android:state_pressed="true"
android:drawable="@drawable/tb_homepage_ff_down"
/>
<!-- android:state_pressed="true" -->
</selector>
解决方案 »
- 【求助】android 调用https接口问题
- 自定义View编译失败。Binary XML file line #255: Error inflating
- 请问:使用r12 sdk运行模拟器报错如何解决?qemu: linux kernel too old to load a ram disk
- 【求助】the application xxx (...) has stopped unexpectedly...
- surfaceview中的hassurface
- android调用.net的webservice,琢磨了很长时间没发现问题所在,求助
- 下载了一个相册滑动的效果,想把它引入到自己的项目运行,要怎么做??
- Activity在什么时候绘制View,才能准确得到View高度?
- 调用完doInBackground 后,不调用 onPostExecute
- android 如何验证wifi密码是否正确
- 如何判断一个电信的测试网站是CTNET,CTWAP的?
- 开发的android上的软件,兼容性测试要覆盖哪些方面
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/tb_homepage_ff_down" />
<item android:state_focused="true" android:drawable="@drawable/tb_homepage_ff_up" />
<item android:drawable="@drawable/tb_homepage_ff_up" />
</selector>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/tb_homepage_ff_down" />
<item android:state_focused="true" android:drawable="@drawable/tb_homepage_ff_up" />
<item android:drawable="@drawable/tb_homepage_ff_up" />
</selector>是用在button View 上的,而你使用了一个layout来模拟按钮,所以不行,你试试给layout增加一个获得焦点的事件监听,在事件中改变layout的背景,具体我没做过,思路应该这样,你自己查下资料吧。