我正在尝试实现自定义对话框。我为对话框的自定义视图创建了单独的xml。在这里,我讨厌该对话框中存在的黑色大标题栏(标题栏)。我需要删除该标题栏,并且我希望它完全与我的xml文件中的一样。
如何从对话框中删除标题栏??
提前致谢..
这是我的自定义对话框的about.xml。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#3BB9FF"
>
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Author : M.Ganesh Babu"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="This is my very first android game app.. Hope everyone like it. Contact me at [email protected]"
android:textAppearance="?android:attr/textAppearanceMedium" android:textColor="#FF7F3B" />
</LinearLayout>
这是我在清单中编写的代码。
<activity
android:name=".About"
android:label="@string/app_name"
android:theme="@android:style/Theme.Dialog"
>
采用,
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
前,
dialog.setContentView(R.layout.yourdialoglayout);
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句