Android   发布时间:2022-04-28  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了android – ImageButton选择器不起作用?大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试使 ImageButton处于压缩,聚焦和正常的状态.
我已经阅读了ImageButton @L_502_1@的介绍

我已将选择器XML文件保存在/ res / drawable /中.还设置了android:src =“@ drawable / my_SELEctor”.

@H_973_6@my_SELEctor.xml文件

<?xml version="1.0" encoding="utf-8"?>
<SELEctor xmlns:android="http://scheR_609_11845@as.android.com/apk/res/android">
    <item android:drawable="@drawable/btn_unfocus" /> <!-- default -->
    <item android:state_pressed="true"
          android:drawable="@drawable/btn_onpress" /> <!-- pressed -->
    <item android:state_focused="true"
          android:drawable="@drawable/btn_onfocus" /> <!-- focused -->
</SELEctor>

我想我已经完成了正确的ImageButton.但它对我不起作用.

这有什么不对?

请指教.

解决方法

应订购商品标签.
所以首先按下,聚焦,最后是认项目

参见Here

大佬总结

以上是大佬教程为你收集整理的android – ImageButton选择器不起作用?全部内容,希望文章能够帮你解决android – ImageButton选择器不起作用?所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。