开发者

Appearance of the spinner

开发者 https://www.devze.com 2023-02-13 01:20 出处:网络
i would like my spinner to be as in the picture.i can do it if i follow the android.developers example,but in my app,its necessary to get the spinner items from the java file and not from the strings.

i would like my spinner to be as in the picture.i can do it if i follow the android.developers example,but in my app,its necessary to get the spinner items from the java file and not from the strings.xml.this is my code(my code creates a spinner as in t开发者_如何学JAVAhe photo but there is radiobutton when the spinner is closed,next to the first spinner item.i want this radio to disappear)

array_spinner=new String[4];
array_spinner[0]="a";
array_spinner[1]="b";
array_spinner[2]="c";
array_spinner[3]="d";

Spinner s = (Spinner) findViewById(R.id.spinner);
ArrayAdapter adapter = new ArrayAdapter(this,android.R.layout.simple_spinner_item, array_spinner);
s.setAdapter(adapter);

Appearance of the spinner

WHEN THE SPINNER IS OPEN:

now:

Appearance of the spinner

I would like to be:

Appearance of the spinner


That one looks like an AlertDialog

Appearance of the spinner

Edit:

Okay, after a short research I found some spinner examples in the API examples. They look like this:

Appearance of the spinner

You can find the code here

0

精彩评论

暂无评论...
验证码 换一张
取 消