`

Android dialog 全屏

 
阅读更多
Android中让Dialog全屏:
一、在style中定义样式:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="Transparent">  
    <item name="android:windowBackground">@color/transparent_background</item>  
    <item name="android:windowNoTitle">true</item>  
    <item name="android:windowFullscreen">true</item>
    <item name="android:windowIsTranslucent">true</item>     
    <item name="android:windowAnimationStyle">@+android:style/Animation.Translucent</item>  
  </style>
</resources>

其中transparent_background为颜色值:#50000000,透明度为50

二、代码中定义Dialog时添加样式:

		final Dialog dialog = new Dialog(this,R.style.Transparent);
		

分享到:
评论
2 楼 gqdy365 2012-11-05  
it耗子 写道
不知道楼主这是什么版本的呢?我这边2.2显示没有android:windowFullscreen这个属性

2.2的版本是可以的,估计是你代码哪儿写的有问题!
1 楼 it耗子 2012-10-31  
不知道楼主这是什么版本的呢?我这边2.2显示没有android:windowFullscreen这个属性

相关推荐

Global site tag (gtag.js) - Google Analytics