码迷,mamicode.com
首页 > 其他好文 > 详细

问一个AlertDialog全屏问题?

时间:2014-10-20 23:17:27      阅读:211      评论:0      收藏:0      [点我收藏+]

标签:android   http   color   io   ar   sp   on   问题   cti   

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


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="@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全屏问题?

标签:android   http   color   io   ar   sp   on   问题   cti   

原文地址:http://www.cnblogs.com/lmyangbk/p/4038849.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!