我更改了ToggleButton的背景,并希望将其重置为默认状态。
更改背景:
btn.setBackgroundColor(Color.parseColor("#FF2929"));
尝试将其更改回来:
btn.setBackgroundResource(0); //Just text, no button
btn.setBackgroundColor(android.R.drawable.btn_default); //Normal button not toggle
答案 0 :(得分:2)
您要在Color中设置drawable,请使用class DevelopmentConfig(Config):
"""
Development configurations
"""
DEBUG = True
SQLALCHEMY_ECHO = True
ASSETS_DEBUG = True
DATABASE = 'teamprojet_db'
print('THIS APP IS IN DEBUG MODE. YOU SHOULD NOT SEE THIS IN PRODUCTION.')
class ProductionConfig(Config):
"""
Production configurations
"""
DEBUG = False
DATABASE = 'teamprojet_prod_db'
。
这应该在你的按钮中设置一些东西。
答案 1 :(得分:0)
在drawable文件夹下创建一个xml文件并放入此代码,目前我输入的xml文件名是check.xml
String[] values = strLine.split(";");
List<String> list = Arrays.asList(values);
if (Collections.frequency(list, list.get(0) > 1) {
System.out.println("The first value is not unique in the list");
}
将此代码放入切换按钮布局xml
中if (list.stream().filter(a -> a.equals(list.get(0))).count() > 1) {
System.out.println("The first value is not unique in the list");
}
这可能会对你有帮助。