How to create android spinner without down triangle on the right side of the widget

后端 未结 8 629
粉色の甜心
粉色の甜心 2020-11-27 04:59

I have a screen where the user has many items to input so screen space is at a premium.

I want the look of the widget on the screen (before the user presses it) t

相关标签:
8条回答
  • 2020-11-27 05:39

    why don't you go for a dialog with list. According to your requirement, create an edittext field, add setOnFocusChangeListener and then show a dialog with list items in onFocusChange() method. For dialog with list items

    new AlertDialog.Builder(this)
                    .setTitle("<Title>")
                    .setItems(R.array.<ItemsArrayName>, new DialogInterface.OnClickListener(){
         @Override
    public void onClick(DialogInterface dialog, int which) {
    // TODO Auto-generated method stub  
    }}).show();
    
    0 讨论(0)
  • 2020-11-27 05:41

    I was having the same issue and changed the style to:

    style="@style/Widget.AppCompat.Light.DropDownItem.Spinner"
    

    and it worked.

    How odd, Its located in DropDownItem.

    While the one that have the bottom triangle is named the normal.

    Cheers!

    0 讨论(0)
提交回复
热议问题