View inflate = LayoutInflater.from(context).inflate(R.layout.qrcode, null);ImageView qrcode = (ImageView) inflate.findViewById(R.id.iv_qrcode);ImageView guanbi = (ImageView) inflate.findViewById(R.id.iv_guanbi);final Dialog dialog = new AlertDialog        .Builder(context)        .setView(inflate)        .show();dialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);Glide.with(context).load(list.get(position).getDwhat()).into(qrcode);Animation animation = AnimationUtils.loadAnimation(context, R.anim.scale);inflate.setAnimation(animation);animation.start();
最关键的一行代码 布局文件

<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="match_parent"    android:layout_height="match_parent"    android:orientation="vertical">    <ImageView        android:id="@+id/iv_qrcode"        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:src="@mipmap/ic_launcher" />    <View        android:layout_width="match_parent"        android:layout_height="80dp"        android:background="#00000000" />    <ImageView        android:id="@+id/iv_guanbi"        android:layout_width="40dp"        android:layout_height="40dp"        android:background="@android:color/transparent"        android:layout_gravity="center"        android:src="@drawable/guanbi" />LinearLayout>


参考链接:https://blog.csdn.net/aaren_jiang/article/details/12993343 注意:要用Dialog去接收

更多相关文章

  1. Android(安卓)图片透明度处理代码
  2. Android(安卓)开发常用代码片段
  3. android截图代码
  4. android1.5---2.1实现js调摄像头,调Java代码
  5. Android将Uri转化为文件路径的方法
  6. Android(安卓)带密码输入界面的Dialog实现机制
  7. Android(安卓)添加新的联系人代码
  8. android一种较为复杂的布局参考(xml文件)
  9. Android(安卓)项目代码混淆

随机推荐

  1. broadcast基础
  2. Android(安卓)弹无虚发之第一弹:Android(
  3. Android进程优先级
  4. 【Android】基础篇:Android中TextView控件
  5. Android四大组件之广播接收器(一)
  6. Android(安卓)自定义 弹框日期选择器 弹
  7. Android(安卓)蓝牙打印指令
  8. App列表之圆角ListView(续)
  9. Android(安卓)圆形头像的两种实现方式
  10. Android(安卓)Bitmap的常用压缩方式