Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change Spinner DropDown width

I need resize this part size to full display. How can i do this?

Example image

My adapter:

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:

<?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> 
like image 541
WOLVERINE Avatar asked Aug 14 '13 15:08

WOLVERINE


1 Answers

Add Attribute in xml file in Spinner tag

android:dropDownWidth="150dp" 
like image 137
Umar Nafeez Avatar answered Sep 17 '22 14:09

Umar Nafeez