android - Android微调器下拉图标隐藏在背景图像下
问题描述
我Spinner
在我的 android 应用程序中使用,我Spinner
在 a中使用LinearLayout
,我使用Relative Layout
图像背景和LinerLayout
内部FrameLayout
来显示背景图像。在这种情况下,我的下拉图标隐藏在背景图像后面。这是我的示例代码。
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="match_parent"
android:orientation="vertical"
android:background="#FFFF"
android:layout_height="match_parent"
android:id="@+id/mainLinearLayout">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="bottom"
android:id="@android:id/background"
android:background="@drawable/devbg"/>
<LinearLayout
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent"
android:id="@+id/linearLayout1">
<Spinner
android:id="@+id/dropStatus"
style="@style/Base.Widget.AppCompat.DropDownItem.Spinner"
android:theme="@style/CardView.Dark"
android:spinnerMode="dropdown"
android:layout_width="180dp"
android:layout_height="30dp"
android:layout_marginBottom="7dp"
android:layout_marginLeft="5dp"
android:textSize="16dp"
android:foregroundTint="#FF000000"
android:backgroundTint="#FF000000"
android:textAlignment="center"
android:drawSelectorOnTop="true"/>
</LinearLayout>
</FrameLayout>
解决方案
不知道你为什么用RelativeLayout
设置背景。删除它并设置背景LinearLayout
,一切都会好起来的。
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="match_parent"
android:orientation="vertical"
android:background="#FFFF"
android:layout_height="match_parent"
android:id="@+id/mainLinearLayout">
<LinearLayout
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent"
android:id="@+id/linearLayout1"
android:background="@drawable/pink">
<Spinner
android:id="@+id/dropStatus"
style="@style/Base.Widget.AppCompat.DropDownItem.Spinner"
android:theme="@style/CardView.Dark"
android:spinnerMode="dropdown"
android:layout_width="180dp"
android:layout_height="30dp"
android:layout_marginBottom="7dp"
android:layout_marginLeft="5dp"
android:textSize="16dp"
android:foregroundTint="#FF000000"
android:backgroundTint="#FF000000"
android:textAlignment="center"
android:drawSelectorOnTop="true"/>
</LinearLayout>
</FrameLayout>
推荐阅读
- python - 如何使用 Python 将 JSON 数据转换为 Avro 格式
- r - R条件两个变量的新变量
- for-loop - 使用 Windows 命令行 FOR 循环从文件中读取带有空格的路径
- microservices - 任何单体应用程序开发的设计实践可以轻松转换为微服务?
- javascript - if 语句中的 switch 语句未执行
- java - 我想计算我编写此代码的最近 20 个闰年,是否可以进一步优化此代码
- git - GIT 推送错误缺少凭据或凭据无效
- arrays - 如何在 Rust 的结构中实现动态二维数组?
- django - 不能将 UserAdmin 文件集与自定义用户模型一起使用
- html - 禁用表单输入