码迷,mamicode.com
首页 > 移动开发 > 详细

Android dialog 全屏

时间:2014-08-02 23:16:44      阅读:282      评论:0      收藏:0      [点我收藏+]

标签:android   style   blog   color   io   cti   ar   代码   

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时添加样式: 

View myLoginView = LayoutInflater.from(mContext).inflate(R.layout.activity_answer_category, null);
ListView cList = (ListView) myLoginView.findViewById(R.id.cagetoryList);
cList.setAdapter(new Adapter());
alertDialog = new Dialog(mContext, R.style.Transparent);
alertDialog.setContentView(myLoginView);
alertDialog.show();

 

Android dialog 全屏,布布扣,bubuko.com

Android dialog 全屏

标签:android   style   blog   color   io   cti   ar   代码   

原文地址:http://www.cnblogs.com/niray/p/3887499.html

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