有没有办法让微调器选项打开另一个微调器?
我希望当有人单击微调器中的选项时,它会打开另一个包含更多选项的微调器。另外,是否有一种方法可以让“其他”选项打开一个 EditText,如果微调器中没有他们的选择,则可以在其中输入他们的选择?
示例:
Spinner 1 有以下选项:
iOS
Android
如果他们选择 iOS,则会立即出现另一个微调器,其中选项是所有 iPhone 版本。 (即,标题为“您拥有哪款 iPhone?”)
如果他们选择 Android,它会执行相同的操作,但使用的是 Android 设备。
如果他们的手机不在第二个旋转器上,他们会输入手机型号。
如果我的代码中已经有第一个旋转器,我该怎么做?
PS,如果需要,我可以发布第一个旋转器的代码,尽管它非常标准。
I want it where when someone clicks an option in a Spinner, it opens another spinner with more options. Also, is there a way for an "Other" option to open an EditText where someone can input their selection if theirs isn't available in the Spinner?
Example:
Spinner 1 has these options:
iOS
Android
And if they select iOS, another spinner comes up immediately where the options are all the iPhone versions. (i.e., titled "Which iPhone do you have?")
And if they select Android, it does the same thing, but with Android devices.
AND if their phone isn't on the second spinner, they type the model of their phone in.
How could I do this if I have the first spinner already in my code?
P.S., if needed, I can post the code for the first spinner, though it's pretty standard.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
基本上根据他们选择的选项以编程方式构建第二个旋转器。我会在每个第二个旋转器中添加“其他”。如果他们选择“其他”,那么您可以显示文本框。
Basically build your second spinner programmatically depending on which option they choose. I'd add "other" to each second spinner. If they choose "other" then you can display the text box.
我希望这对你有用。
试试这个代码...
I hope this will be useful to you.
Try this Code...