更改微调框下拉宽度 [英] Change Spinner DropDown width
本文介绍了更改微调框下拉宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要将此零件尺寸调整为完整显示.我该怎么办?
I need resize this part size to full display. How can i do this?
我的适配器:
String[] navigations = getResources().getStringArray(R.array.actionBar);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(
getBaseContext(), R.layout.custom_spinner_title_bar,
android.R.id.text1, navigations);
adapter.setDropDownViewResource(R.layout.custom_spinner_title_bar);
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
actionBar.setListNavigationCallbacks(adapter, navigationListener);
custom_spinner_title_bar.xml:
custom_spinner_title_bar.xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/RelativeLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="fill_horizontal"
android:orientation="vertical" >
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="5dip"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#FFFFFF" />
</RelativeLayout>
推荐答案
在Spinner
标记的xml
文件中添加属性
Add Attribute in xml
file in Spinner
tag
android:dropDownWidth="150dp"
这篇关于更改微调框下拉宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文