开发者

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:

  1. Create a layout(for example LinearLayout) that seems look like spinner widget(before user click on spinner).
  2. 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.
  3. Add your quasi spinner layout to your UI.
  4. 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).
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜