1

How to reduce spinner size like this, reduce it's width & move it's alignment to right. Please refer below screenshots

What I want is below

I want spinner style like this

What I get...

What I get

4
  • Possible duplicate of How to limit the height of Spinner drop down view in Android Commented Mar 10, 2017 at 12:03
  • @AnkitaShah Height is not a problem for me. I want reduce width of spinner. Like half of parent width. Please help me Commented Mar 10, 2017 at 12:09
  • Set Width of spinner Display display = getWindowManager().getDefaultDisplay(); DisplayMetrics outMetrics = new DisplayMetrics(); display.getMetrics(outMetrics); int leftPaneWidth = outMetrics.widthPixels / 2;popupWindow.setWidth(leftPaneWidth ); Commented Mar 10, 2017 at 12:18
  • 1
    Thanks @AnkitaShah I've achieved this using setDropDownWidth() property of spinner Commented Mar 10, 2017 at 12:34

1 Answer 1

0

Set Width of spinner

Display display = getWindowManager().getDefaultDisplay(); DisplayMetrics outMetrics = new DisplayMetrics(); display.getMetrics(outMetrics); int width = outMetrics.widthPixels / 2; popupWindow.setWidth(width);

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.