1、定义style:

<resources>

<style
        name="dialog_fullscreen">
        <item
            name="android:windowFullscreen">true</item>
        <item
            name="android:windowNoTitle">true</item>
        <item
            name="android:windowBackground">@android:color/transparent</item>
    </style>
</resources>

2、定义layout文件:test_dialog.xml

<LinearLayout
    android:id="@+id/ll_dialog"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_gravity="center"
    android:background="#000000">

……

</LinearLayout>

3、代码中设置:

public class TestDialog extends Dialog

{

public TestDialog(Context context)
    {
        super(context, R.style.dialog_fullscreen);
        // TODO Auto-generated constructor stub
    }

@Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);

setContentView(R.layout.test_dialog);

// 设置背景透明度
        View ll = findViewById(R.id.ll_dialog);
        ll.getBackground().setAlpha(120);// 120为透明的比率
    }

}

Android半透明对话框实现相关推荐

  1. android 半透明 对话框,Android UI设计--半透明效果对话框及activity(可做遮罩层)

    下面是style的一些属性及其解释 自定义对话框效果如下 styles.xml filled_box.xml dialog_animation.xml 在anim目录下创建fading_in.xml, ...

  2. Android之对话框Dialog的创建

    今天我们来讲讲android的对话框(Dialog),大家一定很奇怪为什么从4直接跳到7,因为今天我朋友问了我对话框的用法,所以今天就先讲下这个,至于上两章的上下文菜单(ContextMenu).子菜 ...

  3. 【Android】对话框 AlertDialog

    [Android]对话框 AlertDialog 本讲介绍一下Android基本组件:对话框AlertDialog. 来源:http://blog.csdn.net/feng88724/article ...

  4. Android中对话框的工具类

    Android中对话框的工具类,里面总结了比较好用的方法,直接调用即可 public class DialogUtils {private DialogUtils() {}private static ...

  5. Android系统对话框

    Android系统对话框 效果图 2个按钮的对话框 3个按钮的对话框 自定义View的对话框 单选对话框 多选对话框 列表框 Code XML <?xml version="1.0&q ...

  6. android自定义对话框_Android自定义提醒对话框

    android自定义对话框 In this tutorial, we'll be discussing and implementing Custom Alert Dialogs in our And ...

  7. Android AlertDialog 对话框开启和关闭输入法问题

    Android AlertDialog 对话框开启和关闭输入法问题 AlertDialog 对话框是android jar包自带的对话框,说实话 真的很丑,黑白相间,不是很推荐使用.大多时候 特别是项 ...

  8. 一对一视频聊天软件源码,Android AlertDialog 对话框

    一对一视频聊天软件源码,Android AlertDialog 对话框实现的相关代码 button = (Button) findViewById(R.id.button_alertDialog);b ...

  9. kotlin 对话框_Kotlin教程中的android警报对话框

    kotlin 对话框 Dialogs are present in our every day lives in the digital world. Almost every user knows ...

  10. android 半透明pop,Android实现AppCompatActivity全屏半透明

    平常我们实现一些弹窗会使用到PopWindow,但是PopWindow有时实现不了我们所要的功能和效果,所以这里我用Activity来实现全屏半透明的弹窗 1.首先我们使用Android Studio ...

最新文章

  1. 学习Oracle 最好的5本书,最畅销的Oracle 5本书
  2. Java异常与运行时异常,以及与线程的关系
  3. .NET中Redis安装部署及使用方法简介附-开源Redis操作辅助类
  4. 【安装包】WinSCP
  5. hive if函数_数据仓库,Hive中使用 != 或 lt;gt;; 符号进行条件过滤时的坑
  6. 永洪BI还能这样玩?3招让用户权限管理不再繁琐
  7. js获取时分秒数据格式为YYYMMDDHHmm方法
  8. 繁星花落谁家(屠龙)算法和统计概率结论
  9. [数据库] 一文搞懂case when所有使用场景
  10. nao机器人刷机记录
  11. FiveThirtyEight Comic Characters Dataset(五分之八漫画人物数据集)
  12. DPDK内存(二)内存申请操作
  13. return与finally到底谁先执行
  14. 网站服务器怎么屏蔽ip段,iis屏蔽ip段,网站禁止ip访问
  15. 你的气象图何必如此枯燥
  16. 如何修改机器码,怎么修改机器码,什么是机器码
  17. 百度、阿里、腾讯,豪华阵容终于齐了
  18. 基于Qt的音乐播放器(三)通过酷狗音乐的api接口,返回json格式歌曲信息(播放地址,歌词,图片)
  19. C++中虚函数继承类的内存占用大小计算
  20. dvd清洗碟效果好吗_DVD影碟机使用小技巧 如何保养影碟机

热门文章

  1. 2000-2021年款雷克萨斯原厂全套维修手册+电路图资料下载
  2. Beanshell相关
  3. Win10x64-WDM设备驱动开发入门 - 第六章 VMware-Win10x64+WDK10+VS2015/2019环境搭建与双机调试
  4. 5二十五项反措——防止机网协调事故
  5. 三角网导线平差实例_附和导线坐标平差法实例
  6. excel教程自学网_5个口碑爆棚的自学网站,不花一分钱直接看教程
  7. windows消息钩子
  8. ITIL事件管理流程设计
  9. android打印机驱动4521,三星打印机驱动官方下载
  10. 【Windows 10】U盘量产