我最近探索了 Android 的 BottomNavigationView 组件。我有 4 个菜单项,目前我的 BottomNavigationView 配置如下所示:
<android.support.design.widget.BottomNavigationView
android:id="@+id/activity_product_details_bottom_navigation_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
app:itemBackground="@color/colorPrimary"
app:itemIconTint="@color/menu_select_deselect"
app:itemTextColor="@color/menu_select_deselect"
app:menu="@menu/menu_product_details"/>
Run Code Online (Sandbox Code Playgroud)
我想要的是所选元素和取消选择的元素的区别颜色。我还创建了名为 menu_select_deselect.xml 的颜色状态列表文件,放置在 res/color 目录中,如下所示
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/white" android:state_checked="true"/>
<item android:color="@color/tint_color_deselected"/>
</selector>
Run Code Online (Sandbox Code Playgroud)
menu_product_details.xml 如下
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/menu_product_details_home"
app:showAsAction="ifRoom"
android:enabled="true"
android:icon="@drawable/ic_home"
android:title="@string/menu_product_details_home" />
<item
android:id="@+id/menu_product_details_product_documents"
app:showAsAction="ifRoom"
android:enabled="true"
android:icon="@drawable/ic_product_documents"
android:title="@string/menu_product_details_product_documents" />
<item
android:id="@+id/menu_product_details_product_part_list"
app:showAsAction="ifRoom"
android:enabled="true"
android:icon="@drawable/ic_product_part_list"
android:title="@string/menu_product_details_product_part_list" />
<item
android:id="@+id/menu_product_details_product_service"
app:showAsAction="ifRoom"
android:enabled="true"
android:icon="@drawable/ic_product_service"
android:title="@string/menu_product_details_product_service" />
</menu>
Run Code Online (Sandbox Code Playgroud)
任何人都可以帮助我解决代码有什么问题,因为即使我单击其他 3 个项目,也只有第一个元素以白色显示?
我不小心在 Google Play Console(新 UI)上创建了封闭测试轨道而不是内部测试轨道。现在,我想删除它或确保它不会向公众推出,因为我需要在生产轨道中将我的 Live 版本推到它之上。目前,我已经暂停了封闭测试轨道构建,Google 显示了以下选项,那么如果我单击“审核并发布”按钮可以吗?我参考了 Stackoverflow 上的其他帖子,但他们建议直接删除该曲目,但它指的是 Google Play Console 的经典 UI。
有人能提出更好的主意吗?
我有一个场景,我想在用户键入内容时过滤数据。我目前正在使用 Spinner,但我想要的是用户应该能够在 Spinner 本身上写入数据,并且数据在运行时被过滤。我找不到与我想要的类似的东西。
类似于下图的东西(它是 ASP.net 中使用的 RadcomboBox 示例)。