We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
展示异常
然后可以点击的时候,按压效果只有背景有效,文字按压效果丢失
如果只设置文字的按压效果,不设置是否可以点击的效果,就能正常按压变色
The text was updated successfully, but these errors were encountered:
文字颜色应该是少了一个默认的颜色 // 定义不同状态下的颜色值 int[][] states = new int[][] { new int[] { android.R.attr.state_pressed }, // 按下状态 new int[] { android.R.attr.state_enabled}, // 获取可点击状态 new int[] {} // 默认状态 };
int[] colors = new int[] { getResources().getColor(R.color.button_pressed_color), // 按下状态颜色 getResources().getColor(R.color.button_fstate_enabled_color), // 获取可点击状态颜色 getResources().getColor(R.color.button_normal_color) // 默认不可以点击状态颜色 };
// 创建ColorStateList ColorStateList colorStateList = new ColorStateList(states, colors);
Sorry, something went wrong.
No branches or pull requests
展示异常
然后可以点击的时候,按压效果只有背景有效,文字按压效果丢失
如果只设置文字的按压效果,不设置是否可以点击的效果,就能正常按压变色
The text was updated successfully, but these errors were encountered: