Android半透明对话框实现
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半透明对话框实现相关推荐
- android 半透明 对话框,Android UI设计--半透明效果对话框及activity(可做遮罩层)
下面是style的一些属性及其解释 自定义对话框效果如下 styles.xml filled_box.xml dialog_animation.xml 在anim目录下创建fading_in.xml, ...
- Android之对话框Dialog的创建
今天我们来讲讲android的对话框(Dialog),大家一定很奇怪为什么从4直接跳到7,因为今天我朋友问了我对话框的用法,所以今天就先讲下这个,至于上两章的上下文菜单(ContextMenu).子菜 ...
- 【Android】对话框 AlertDialog
[Android]对话框 AlertDialog 本讲介绍一下Android基本组件:对话框AlertDialog. 来源:http://blog.csdn.net/feng88724/article ...
- Android中对话框的工具类
Android中对话框的工具类,里面总结了比较好用的方法,直接调用即可 public class DialogUtils {private DialogUtils() {}private static ...
- Android系统对话框
Android系统对话框 效果图 2个按钮的对话框 3个按钮的对话框 自定义View的对话框 单选对话框 多选对话框 列表框 Code XML <?xml version="1.0&q ...
- android自定义对话框_Android自定义提醒对话框
android自定义对话框 In this tutorial, we'll be discussing and implementing Custom Alert Dialogs in our And ...
- Android AlertDialog 对话框开启和关闭输入法问题
Android AlertDialog 对话框开启和关闭输入法问题 AlertDialog 对话框是android jar包自带的对话框,说实话 真的很丑,黑白相间,不是很推荐使用.大多时候 特别是项 ...
- 一对一视频聊天软件源码,Android AlertDialog 对话框
一对一视频聊天软件源码,Android AlertDialog 对话框实现的相关代码 button = (Button) findViewById(R.id.button_alertDialog);b ...
- kotlin 对话框_Kotlin教程中的android警报对话框
kotlin 对话框 Dialogs are present in our every day lives in the digital world. Almost every user knows ...
- android 半透明pop,Android实现AppCompatActivity全屏半透明
平常我们实现一些弹窗会使用到PopWindow,但是PopWindow有时实现不了我们所要的功能和效果,所以这里我用Activity来实现全屏半透明的弹窗 1.首先我们使用Android Studio ...
最新文章
- 学习Oracle 最好的5本书,最畅销的Oracle 5本书
- Java异常与运行时异常,以及与线程的关系
- .NET中Redis安装部署及使用方法简介附-开源Redis操作辅助类
- 【安装包】WinSCP
- hive if函数_数据仓库,Hive中使用 != 或 lt;gt;; 符号进行条件过滤时的坑
- 永洪BI还能这样玩?3招让用户权限管理不再繁琐
- js获取时分秒数据格式为YYYMMDDHHmm方法
- 繁星花落谁家(屠龙)算法和统计概率结论
- [数据库] 一文搞懂case when所有使用场景
- nao机器人刷机记录
- FiveThirtyEight Comic Characters Dataset(五分之八漫画人物数据集)
- DPDK内存(二)内存申请操作
- return与finally到底谁先执行
- 网站服务器怎么屏蔽ip段,iis屏蔽ip段,网站禁止ip访问
- 你的气象图何必如此枯燥
- 如何修改机器码,怎么修改机器码,什么是机器码
- 百度、阿里、腾讯,豪华阵容终于齐了
- 基于Qt的音乐播放器(三)通过酷狗音乐的api接口,返回json格式歌曲信息(播放地址,歌词,图片)
- C++中虚函数继承类的内存占用大小计算
- dvd清洗碟效果好吗_DVD影碟机使用小技巧 如何保养影碟机