ljbade ljbade - 9 months ago 100
Android Question

How to set correct text size for a Spinner in an Android Toolbar action bar

I followed these instructions to add a spinner to my Toolbar which I am using as the action bar in my Android app.

However the text size is too small.

How do I get the correct text size for an action bar item?

For an example of the correct size see the Action Bar guide.


Try adding the below property to your spinner item, it worked for me :


Hope this helps..

Edit :

Okay, I wasn't telling you about toolbar, let me show an example which might help you :

I assumed in my answer that you have a custom layout defined for spinner, if not then have a look at below code :

Define spinnerLayout.xml file in your layout resource :

<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"

Now, add this in your activity :

Spinner spinner = (Spinner) findViewById(R.id.spinner);   // Your spinner id in layout.
ArrayAdapter<String> adapter = ArrayAdapter.createFromResource(this,


So, I was telling to set your textSize in spinner to "?attr/actionBarSize", you can set it anything, as big as you want.

I am sorry, I by mistake wrote in my previous answer : android:layout_height property, I have corrected it.

Hope this helps....