<legend id='eEG6B'><style id='eEG6B'><dir id='eEG6B'><q id='eEG6B'></q></dir></style></legend>
  1. <small id='eEG6B'></small><noframes id='eEG6B'>

      <bdo id='eEG6B'></bdo><ul id='eEG6B'></ul>

  2. <i id='eEG6B'><tr id='eEG6B'><dt id='eEG6B'><q id='eEG6B'><span id='eEG6B'><b id='eEG6B'><form id='eEG6B'><ins id='eEG6B'></ins><ul id='eEG6B'></ul><sub id='eEG6B'></sub></form><legend id='eEG6B'></legend><bdo id='eEG6B'><pre id='eEG6B'><center id='eEG6B'></center></pre></bdo></b><th id='eEG6B'></th></span></q></dt></tr></i><div id='eEG6B'><tfoot id='eEG6B'></tfoot><dl id='eEG6B'><fieldset id='eEG6B'></fieldset></dl></div>
    1. <tfoot id='eEG6B'></tfoot>
    2. 如何在android中创建上述自定义对话框?

      时间:2023-06-27
      <i id='GGCgo'><tr id='GGCgo'><dt id='GGCgo'><q id='GGCgo'><span id='GGCgo'><b id='GGCgo'><form id='GGCgo'><ins id='GGCgo'></ins><ul id='GGCgo'></ul><sub id='GGCgo'></sub></form><legend id='GGCgo'></legend><bdo id='GGCgo'><pre id='GGCgo'><center id='GGCgo'></center></pre></bdo></b><th id='GGCgo'></th></span></q></dt></tr></i><div id='GGCgo'><tfoot id='GGCgo'></tfoot><dl id='GGCgo'><fieldset id='GGCgo'></fieldset></dl></div>

        • <small id='GGCgo'></small><noframes id='GGCgo'>

            <bdo id='GGCgo'></bdo><ul id='GGCgo'></ul>

            • <tfoot id='GGCgo'></tfoot>
                <tbody id='GGCgo'></tbody>
            • <legend id='GGCgo'><style id='GGCgo'><dir id='GGCgo'><q id='GGCgo'></q></dir></style></legend>

                本文介绍了如何在android中创建上述自定义对话框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                有人可以告诉我如何创建与链接 [此处][1] 类似/完全相同的上述对话框视图,问题的重点是在图片中心创建视图吗?

                Can someone tell me how to create the above dialog view similar/exactly to the link [here][1], whereby the focus of the problem is to create the view in the centre of the picture?

                我做了一些研究,这让我想知道我应该使用自定义 xml 来创建自定义对话框视图,还是应该使用 alertdialog 来创建上面显示的确切视图可编程性?即使alertdialog 是可能的,我将如何适应对话框图片中间显示的这么多textview 消息给定alertdialog 限制?例如:builder.setMessage("这是警报正文");"如果你知道我的意思!!

                I have done some research and it made me wonder should i be using a custom xml to create a custom dialog view or should i be using alertdialog to create the exact view programmability shown above? And even if alertdialog is possible how am i going to accommodate with so many textview messages shown in the middle of the dialog picture given alertdialog limitation? Eg: "builder.setMessage("This is the alert's body");" If you know what i mean!!

                有人能告诉我获得完全相同视图的最简单方法吗,因为我正在做同样的应用程序并且是 android 的新手.谢谢 :)

                Can someone tell me the easiest way to get the exact same view because i'm kinna doing the same app and new to android.. Thanks :)

                推荐答案

                最好的方法是自定义对话框.因为这将有助于创建所有这些背景颜色和效果.我确定您发布的链接也使用了自定义对话框,

                The best approach will be custom dialog. As it will be helpful creating all those background colours and the effect. I am sure the link you have posted is using custom dialog as well,

                干杯

                可能有帮助的链接:

                [1] http://developer.android.com/guide/topics/ui/dialogs.html#CustomDialog

                [2] http://androidideasblog.blogspot.com/2010/02/creating-custom-dialog-in-android.html

                ///在您的代码实现中,只需在创建对话框时添加此代码....之后只需将所有 TextView 安排在您的布局中,并将该布局 id 添加到下面的代码中,祝您好运

                /// In your code implementations just add this code when you create dialog....after having this just have all TextView arranged in your layout and add that layout id to this below code good luck

                //Dialog box creator
                private Dialog constructYourDialog()
                {
                    //Preparing views
                  LayoutInflater inflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
                  View layout = inflater.inflate(R.layout.***your_xml_name***, (ViewGroup) findViewById(R.id.***Yout view id***));
                    //Building dialog
                    AlertDialog.Builder builder = new AlertDialog.Builder(this);
                    builder.setView(layout);
                
                    builder.setPositiveButton("Show Videos", new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog, int which) {
                                Log.i("","Show Video Click");
                                dialog.dismiss();
                    });
                    builder.setNegativeButton("E-Mail", new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog, int which) {
                           Log.i("","E-mail Click");
                           dialog.dismiss();
                        }
                    });
                     builder.setNeutralButton("Show Map", new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog, int which) {
                            Log.i("","Show Map Click");
                            dialog.dismiss();
                        }
                    });
                          AlertDialog alert = builder.create();
                    return alert;
                
                }
                

                这篇关于如何在android中创建上述自定义对话框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:Android - 创建进度对话框 下一篇:Java Swing 内部框架作为对话框

                相关文章

                <i id='nJY9p'><tr id='nJY9p'><dt id='nJY9p'><q id='nJY9p'><span id='nJY9p'><b id='nJY9p'><form id='nJY9p'><ins id='nJY9p'></ins><ul id='nJY9p'></ul><sub id='nJY9p'></sub></form><legend id='nJY9p'></legend><bdo id='nJY9p'><pre id='nJY9p'><center id='nJY9p'></center></pre></bdo></b><th id='nJY9p'></th></span></q></dt></tr></i><div id='nJY9p'><tfoot id='nJY9p'></tfoot><dl id='nJY9p'><fieldset id='nJY9p'></fieldset></dl></div>
                  • <bdo id='nJY9p'></bdo><ul id='nJY9p'></ul>
                  <tfoot id='nJY9p'></tfoot>

                  1. <small id='nJY9p'></small><noframes id='nJY9p'>

                  2. <legend id='nJY9p'><style id='nJY9p'><dir id='nJY9p'><q id='nJY9p'></q></dir></style></legend>