how to change the dropdown height in spinner

后端 未结 11 1650
粉色の甜心
粉色の甜心 2021-02-05 11:20

i tried a lot to change the dropdown item height of spinner.. but i couldn\'t get a good solution.. plz help me guys..

here is a code loginactivityview.xml



        
11条回答
  •  广开言路
    2021-02-05 12:03

    Override method in ArrayAdapter class

    @Override
    public View getDropDownView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
        View view = super.getDropDownView(position, convertView, parent);
        view.getLayoutParams().height = 50;
        return view;
    }
    

提交回复
热议问题