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

    1. <tfoot id='vpG7A'></tfoot>
        <bdo id='vpG7A'></bdo><ul id='vpG7A'></ul>

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

        无法创建圆角对话框(Android-Eclipse)

        时间:2023-08-30
          <tbody id='6xdns'></tbody>

          <legend id='6xdns'><style id='6xdns'><dir id='6xdns'><q id='6xdns'></q></dir></style></legend>

            <small id='6xdns'></small><noframes id='6xdns'>

            <tfoot id='6xdns'></tfoot>
              <bdo id='6xdns'></bdo><ul id='6xdns'></ul>

              1. <i id='6xdns'><tr id='6xdns'><dt id='6xdns'><q id='6xdns'><span id='6xdns'><b id='6xdns'><form id='6xdns'><ins id='6xdns'></ins><ul id='6xdns'></ul><sub id='6xdns'></sub></form><legend id='6xdns'></legend><bdo id='6xdns'><pre id='6xdns'><center id='6xdns'></center></pre></bdo></b><th id='6xdns'></th></span></q></dt></tr></i><div id='6xdns'><tfoot id='6xdns'></tfoot><dl id='6xdns'><fieldset id='6xdns'></fieldset></dl></div>
                  本文介绍了无法创建圆角对话框(Android-Eclipse)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我正在尝试为我的应用程序对话框制作自定义对话框形状.我一直在寻找这个主题几个小时,但我找到的解决方案对我不起作用,这就是为什么我问你我自己的问题.我想要一个带有圆角的对话框并显示一个标题,然后是一个带有一些文本的 ScrollView.唯一对我不起作用的是圆角.在这里我把我的代码贴给你:

                  I'm trying to make a custom dialog shape for my app's dialogs. I've been searching for this topic for hours, but the solutions I find don't work for me, that's why I ask you for my own problem. I want a Dialog with rounded corners and showing a title and then a ScrollView with some text. The only thing that is not working to me is the rounded corners. Here I post you my code:

                  我的 AndroidManifest.xml 带有我想要的活动以及我的圆角对话框:

                  my AndroidManifest.xml with the activity I want with my rounded-corners Dialog:

                  <activity 
                          android:name=".AboutNacimiento"
                          android:label="@string/about_nac_title"
                          android:theme="@style/Theme.CustomDialogTheme"
                          android:screenOrientation="nosensor">
                      </activity>
                  

                  然后我的资源具有各自的样式 (res/layout/values/dialogTheme.xml)

                  then my resource with respective styles (res/layout/values/dialogTheme.xml)

                  <?xml version="1.0" encoding="utf-8"?>
                  <resources>
                  
                  <style name="Theme.CustomDialogTheme" 
                      parent="@android:style/Theme.Dialog">
                      <item name="android:windowTitleStyle">@style/dialog_title_style</item>
                      <item name="android:background">@drawable/rounded_dialog</item>     
                  
                  </style>
                  
                  <style name="dialog_title_style" parent="@android:Widget.TextView">
                      <item name="android:background">@color/titulo_color</item>
                      <item name="android:padding">10dip</item>
                      <item name="android:textSize">20sp</item>
                      <item name="android:gravity">center</item>
                      <item name="android:textStyle">bold</item>
                      <item name="android:textColor">@color/texto_blanco</item>
                  </style>    
                  

                  最后是我想要的圆形对话框的形状 (res/drawable/rounded_dialog.xml):

                  and finally the shape I want for my rounded dialog (res/drawable/rounded_dialog.xml) :

                  <?xml version="1.0" encoding="utf-8"?>
                  <shape xmlns:android="http://schemas.android.com/apk/res/android"
                  
                  android:shape="rectangle" >
                  <solid android:color="@color/background_color"/>
                  <stroke android:color="#7F7F7F" android:width="1dp" />
                  <corners
                      android:radius="20dp"/> 
                  </shape>
                  

                  但我得到的唯一圆形"的东西是 TextViews 中的一些边框......

                  but the only "rounded" thing I'm getting are some borders in the TextViews...

                  http://imageshack.us/photo/my-images/515/问题ab.jpg

                  你能帮我得到我想要的对话框吗?

                  could you please help me to get my desired Dialog?

                  推荐答案

                  移除默认android框架的关键是:

                  The key thing to remove default android frame is:

                  MyDialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
                  

                  这是完整的例子:

                  Dialog MyDialog= new Dialog(MyActivity.this);
                  MyDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
                  MyDialog.setContentView(R.layout.my_custom_dialog);
                  MyDialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
                  MyDialog.show();
                  

                  这篇关于无法创建圆角对话框(Android-Eclipse)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何在警报对话框中放置搜索栏? 下一篇:将 Theme.Dialog 更改为 Android 中的 Theme.Light.Dialog

                  相关文章

                  最新文章

                  • <bdo id='8ZPlz'></bdo><ul id='8ZPlz'></ul>

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

                  1. <tfoot id='8ZPlz'></tfoot>
                    <legend id='8ZPlz'><style id='8ZPlz'><dir id='8ZPlz'><q id='8ZPlz'></q></dir></style></legend>
                    1. <small id='8ZPlz'></small><noframes id='8ZPlz'>