简体   繁体   English

单击按钮的Android OPEN微调器

[英]Android OPEN spinner with single button click

I have implemented button which clicks and opens dialog with spinner inside as described here 我已经实现按钮,点击并按照上述方法用微调打开的对话框中点击这里

However this is two clicks. 但这是两次点击。 One to open dialog and one to open spinner. 一个打开对话框,一个打开微调器。 I want the spinner to open with a single click of the button? 我希望只需单击按钮即可打开微调器? How can this be done? 如何才能做到这一点?

Is there anyway to just open spinner from button click w/o going to dialog. 无论如何只需通过按钮单击打开微调器即可进入对话框。 If not how can I open dialog view and have the spinner open at same time. 如果不是,我如何打开对话框视图并同时打开微调器。

把它放在你的按钮中。单击

spinner.performClick();

在活动中定义一个微调器,在xml中有0高度和0宽度,然后onItemSelected将起作用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM