Spinner - how to set border around dropdown list?

I have this counter and want to know how I can place a border around this

Spinner dropdown = (Spinner)findViewById(R.id.spinnerUpdateContactMethod); String[] items = new String[]{"1", "2", "three"}; ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, items); dropdown.setPrompt("Please select "); dropdown.setAdapter(adapter); 

the tooltip does not actually appear on the screen. Please help me with this.

+7
android spinner
source share
2 answers

for the user border you can create an xml file inside the folder with the ability to copy

 <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <solid android:color="@color/white_overlay_8x" /> <corners android:radius="6dip" /> <stroke android:color="@color/white" android:width="@dimen/dot" /> </shape> 

and install

 android: background=@drawable /file; 

in your spinner (xml activity file)

+16
source share

this will make quite a bit of space, but not border

 dropdown.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); 

you can add this to your Spinner instance

The best thing would be to customize, in which you can do a lot more than just a frame

0
source share

All Articles