问一个AlertDialog全屏问题?

savior120 2014-07-07 07:38:11
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


结果还是无法全屏啊。麻烦告诉解答一下,谢谢!
...全文
337 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
hufen2740 2014-09-17
  • 打赏
  • 举报
回复
2楼的Dialog能全屏 AlertDialog 根本不能全屏啊
哎,真难 2014-07-08
  • 打赏
  • 举报
回复
好吧,我又回来了,看下二楼的自定dialog的theme,这样可以全屏,,,
wuyuhangtony 2014-07-08
  • 打赏
  • 举报
回复
啊?没试过~帮不了你~哈哈哈哈哈
箍心而行 2014-07-08
  • 打赏
  • 举报
回复
将dialog设置成系统警告级别 然后全屏 可以屏蔽home键 懂吗? 不懂就在那说人脑子有病 真s b
fireyou 2014-07-08
  • 打赏
  • 举报
回复
你得改framework里的dialog的设置吧
風言楓語 2014-07-07
  • 打赏
  • 举报
回复
dialog = new Dialog(context,R.style.dialog); View view = View.inflate(context, R.layout.dialog_login_protocol, null); dialog.setContentView(view); dialog.show(); <style name="dialog" parent="@android:style/Theme.Dialog"> <item name="android:windowNoTitle">true</item> <item name="android:windowBackground">@color/transparent_00000000</item> <item name="android:windowIsFloating">false</item> </style>
逍遥笑 2014-07-07
  • 打赏
  • 举报
回复
汗,你为什么要将dialog全屏啊,那样还不如用一个activity来实现
windfury_plus 2014-07-07
  • 打赏
  • 举报
回复
对话框全屏没啥意思吧。 popupwindow也是个做对话框不错的选择~自定义方便一些。网上很多例子
zhou78935001 2014-07-07
  • 打赏
  • 举报
回复
dialog全屏,你确定你脑子没问题?

80,349

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧