Android的微调 - 如何让下拉列表视图的透明? [英] Android Spinner - How to make dropdown view transparent?

查看:182
本文介绍了Android的微调 - 如何让下拉列表视图的透明?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在/ RES定制微调下拉xml文件/布局/:

I have a custom spinner dropdown xml file in /res/layout/:

spinner_view_dropdown.xml:

<?xml version="1.0" encoding="UTF-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/spinner_item_dropdown"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@android:color/transparent"
style="@style/spinner_item_dropdown" />

我通过Java设置微调下拉列表:

I'm setting the spinner dropdown via java:

// "Spinner", aka breadcrumbs
	Spinner spin = (Spinner) findViewById(R.id.breadcrumb_dropdown);

	ArrayAdapter adapter = ArrayAdapter.createFromResource(this, R.array.breadcrumb, R.layout.spinner_view);

	adapter.setDropDownViewResource(R.layout.spinner_view_dropdown);

	spin.setAdapter(adapter);
	// /"Spinner"

不幸的是,在白色背景上的微调弹出仍然存在,不管我将背景设置为透明。

Unfortunately, a white background still exists on the spinner popup regardless if I set the background to transparent.

我该如何解决这个问题?

How do I fix this?

推荐答案

我怀疑你不能。该下拉是,你是不是创造,因此没有直接控制的对话框。

I suspect you can't. The "drop-down" is a dialog that you are not creating and therefore have no direct control over.

这篇关于Android的微调 - 如何让下拉列表视图的透明?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆