1
我正在使用QuickAction3D库,我想在点击QuickAction时使背景不透明,就像正常的AlertDialog所做的那样,它有这样做的方法吗?如何制作不透明的活动?
非常感谢您
编辑
我的意思的活动去一个不透明的颜色,和快速的行动保护它的当前颜色。例如,如果显示AlertDialog,则后台活动将变为不透明,而AlertDialog则显示为清晰的颜色。
我正在使用QuickAction3D库,我想在点击QuickAction时使背景不透明,就像正常的AlertDialog所做的那样,它有这样做的方法吗?如何制作不透明的活动?
非常感谢您
编辑
我的意思的活动去一个不透明的颜色,和快速的行动保护它的当前颜色。例如,如果显示AlertDialog,则后台活动将变为不透明,而AlertDialog则显示为清晰的颜色。
Quich action 3d 看到该库为背景,他们使用了选择绘制action_item_btn.xml,你可以自定义代码,以使按照乌拉圭回合need.They已设置为
<item
android:state_pressed="true"
android:drawable="@drawable/action_item_selected"/>
为背景如果u想要为列表中的项目设置选择器,您可以设置选择器,用于当前存在的imageView,
创建一个背景可绘制资源,例如item_background.xml
,在你/drawable
文件夹,包含这样的事情:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/color1" android:state_pressed="true"/>
<item android:drawable="@color/color2" android:state_selected="true"/>
<item android:drawable="@color/color3" android:state_activated="true"/>
<item android:drawable="@color/color4"/>
</selector>
然后在您/values/colors.xml
文件提供的颜色值:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="color1">#DDff8800</color>
<color name="color2">...</color>
<!-- more colors... -->
</resources>
最后,设置绘制资源作为项目背景,你的布局android:background="@drawable/item_background"
。
会使整个活动不透明?或只是按钮? – NemesisDoom
根据你的编辑你应该为我提到的文件设置bg并将#80000000设置为bg并尝试 –