EditText和Spinner对话框 [英] Dialog box with EditText and Spinner

查看:179
本文介绍了EditText和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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆