【问题标题】:How to remove Black Rectangle box in Dialog?如何删除对话框中的黑色矩形框?
【发布时间】:2013-05-15 09:43:27
【问题描述】:

我使用以下代码准备了一个自定义对话框,它在黑色矩形框中显示了我的自定义布局。

final Dialog dialog = new Dialog(getParent(),R.style.PauseDialog);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); 
dialog.setContentView(R.layout.social_share);
dialog.setTitle("Social Sharing");
dialog.setCancelable(true);

如何删除该框,它应该只显示我的自定义布局。

谢谢!

【问题讨论】:

  • 粘贴你的风格代码
  • 你能提供一个你想要什么和你得到什么的快照吗......这会让你更清楚
  • 我有一张图片,但是我没有足够的声誉

标签: android user-interface dialog


【解决方案1】:

您可以在自定义对话框中根据您的要求使用<shape> 设置背景

custom_dialog_layout.xml 中:

android:background = "@layout/dialog_shape"

然后在 dialog_shape.xml:

<?xml version="1.0" encoding="UTF-8"?> 
<shape xmlns:android="http://schemas.android.com/apk/res/android" 
     android:shape="rectangle" > 
     <gradient android:startColor="#FF0E2E57" 
     android:endColor="#FF0E2E57" 
            android:angle="225" android:paddingLeft="20dip"/> 
</shape>

【讨论】:

  • 你能告诉我需要在透明中添加什么
猜你喜欢
  • 1970-01-01
  • 2013-04-01
  • 2017-11-10
  • 2011-12-28
  • 1970-01-01
  • 1970-01-01
  • 2019-11-17
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多