在Android中从对话框中删除标题

在Android中从对话框中删除标题,android,android-layout,Android,Android Layout,如何删除自定义对话框的标题。并删除其空格。 谢谢。 我的布局 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="top" &g

如何删除自定义对话框的标题。
并删除其空格。
谢谢。
我的布局

 <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="top" >
<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginLeft="78dp"
    android:layout_marginTop="2dp"
    android:background="#00000000"
    android:gravity="top"
    android:text="Click to the button "
    android:textColor="#ffff00"
    android:textSize="15sp" />

</LinearLayout>
我正在使用
对话框.requestWindowFeature(窗口.FEATURE\u无\u标题);
避免标题,但只避免文本而不是空格。

为什么要为对话框设置标题,而您已经想删除标题?你应该这样做:

final Dialog dialog = new Dialog(this);
LayoutInflater inflater = getLayoutInflater();
View view = inflater.inflate(R.layout.splash, null)
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
dialog.setContentView(view);
dialog.show();

删除行对话框。setTitle()。
然后就可以了。

您的问题在哪里?我想删除我的自定义对话框titilepost,首先为对话框发布代码
final Dialog dialog = new Dialog(this);
LayoutInflater inflater = getLayoutInflater();
View view = inflater.inflate(R.layout.splash, null)
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
dialog.setContentView(view);
dialog.show();