How should I increase the spinner list item font size?

后端 未结 5 1615
野的像风
野的像风 2020-12-08 04:27

This is my spinner\'s code:

Spinner food = (Spinner) findViewById(R.id.spinner1);
ArrayAdapter foodadapter = ArrayAdapter.createFromResou         


        
5条回答
  •  醉梦人生
    2020-12-08 05:04

    Save the below xml as spinner_layout.xml in layout folder

    
    
    

    change the textSize which you want. and use the below adapter code to fill it.

    Spinner food = (Spinner) findViewById(R.id.spinner1);
    ArrayAdapter foodadapter = ArrayAdapter.createFromResource(
                this, R.array.item_array, R.layout.spinner_layout);
    foodadapter.setDropDownViewResource(R.layout.spinner_layout);
    food.setAdapter(foodadapter);
    

提交回复
热议问题