这是标准的AlertDialog还是自定义的?

时间:2010-11-18 03:22:12

标签: android

我希望在我的应用中复制并改进以下AlertDialog

http://i.stack.imgur.com/aU3Ep.png

这是内置的AlertDialog,还是从头开始制作的?如果它是从头开始制作的,那么哪个控件/小部件是数字选择器?或者也是从头开始构建的?

谢谢!

btw ..截图来自Math Alarm Clock Pro

2 个答案:

答案 0 :(得分:0)

看起来像标准对话框设置为没有标题。然后它有一个EditText夹在两个按钮之间,底部有一个确认按钮。

编辑:这是我的应用程序中的onCreateDialog覆盖的简略片段。

Dialog dialog;
dialog = new Dialog(this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);

答案 1 :(得分:0)

看起来像自定义对话框,如下所示:http://developer.android.com/guide/topics/ui/dialogs.html#CustomDialog

有点类似于这个: http://www.quietlycoding.com/?p=5

这意味着:定制。

如果您在Google上搜索“android NumberPicker”

,您会发现一些有趣的链接

内置对话框是AlertDialog,DatePickerDialog,ProgressDialog,TimePickerDialog(请参阅developer.android.com/reference/android/app/AlertDialog.html)

这解释了默认的AlertDialogs:http://developer.android.com/guide/topics/ui/dialogs.html

但是在AlertDialog(setView(...))中有一个有趣的功能可以用来制作上面的内容(但是你必须自己创建视图 - edittext和两个按钮以及okay按钮 - 并分配onclickevents) 。请参阅此处的功能:http://developer.android.com/reference/android/app/AlertDialog.html#setView(android.view.View