首页 > 代码库 > 问一个AlertDialog全屏问题?

问一个AlertDialog全屏问题?

============问题描述============


xml<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >
    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:gravity="center"
        android:background="@color/cl_beige"
        android:layout_weight="9" >
        <ImageView
            android:id="@+id/imageview_copyright"
            android:src="http://www.mamicode.com/@drawable/ic_copyright"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:scaleType="centerInside" />
    </RelativeLayout>
    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:gravity="center"
        android:background="@color/cl_beige"
        android:layout_weight="1" >
        <TextView
            android:id="@+id/textview_copyright"
            android:background="@color/cl_beige"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:textColor="@color/cl_black"
            android:text="COPYRIGHT OF ..."  />
    </RelativeLayout>
</LinearLayout>


下面代码一个启动activity的onCreate过程上

AlertDialog dialog;
        LayoutInflater layoutInflater = LayoutInflater.from(ct);
        final View view = layoutInflater.inflate(id, null);
        dialog = new AlertDialog.Builder(ct).create();
        dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
        dialog.setView(view,0,0,0,0);//view,viewSpacingLeft,viewSpacingTop,viewSpacingRight,viewSpacingBottom


结果还是无法全屏啊。麻烦告诉解答一下,谢谢!

============解决方案1============


将dialog设置成系统警告级别  然后全屏  可以屏蔽home键 懂吗?  不懂就在那说人脑子有病 真s b

问一个AlertDialog全屏问题?