EditText和Spinner对话框 [英] Dialog box with EditText and Spinner
问题描述
我希望对话框有一个 EditText
和$ code> Spinner
我不知道我如何设置它的视图,我有一个 AlertDialog
的代码,它的工作原理,它只是 EditText
和 Spinner
,我需要放在里面,然后我可以继续使用其余的应用程序的代码。
请有人显示我如何添加一个 EditText
和 Spinner
?
我可以想到的两个选项:
1)使用 AlertDialog
的 setView 方法
2)创建一个活动
与
android:theme =@ android:style / Theme.Dialog
在您的 AndroidManifest
中。
数字应该更容易做,而数字两个会给你更多的灵活性。
I have a button that pops up with a dialog box on click.
I want the dialog box to have an EditText
and a Spinner
inside the dialog box.
I don't know how I'd set the view for it, I have the code for an AlertDialog
and it works, it's just the EditText
and Spinner
that I need to place inside it then I can get on with the rest of the app's code.
Please can someone show me how I'd add an EditText
and Spinner
please?
Two options I can think of:
1) Use AlertDialog
's setView method.
2) Create an Activity
with
android:theme="@android:style/Theme.Dialog"
in your AndroidManifest
.
Number one should be easier to do while number two will give you more flexibility.
这篇关于EditText和Spinner对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!