How to set parameter for dropdown list for the spinner in Android?
I have used Spinner
in my XML
file. It is working fine. When 开发者_如何学JAVAI click on the spinner, it shows a list of items for that spinner, but the size of dropdown
list is so large which covers the whole screen. That's why it doesn't look good. So I want to know how I can set the width and height of the dropdown
list so that it would look better.
I have no idea to solve your problem directly,but you can do these steps:
- Create a layout(for example LinearLayout) that seems look like spinner widget(before user click on spinner).
- Create an activity with theme semitransparent or dialog and put a layout that is look like list for selecting spinner items and user sees it when clicked on spinner.
- Add your quasi spinner layout to your UI.
- Register a Click-listener for your quasi spinner,so that when user clicks on it,sees activity that contains list for selecting(start this activity for result,when user clicks your quasi spinner).
精彩评论