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 6.0权限问题处理的核心代码--shouldShowRequestPermissi
  2. Android 添加新的联系人代码
  3. 解决TabLayout+viewpager 滑动切换时 布局文件不是从头显示
  4. Android 图片透明度处理代码
  5. android截图代码
  6. android1.5---2.1实现js调摄像头,调Java代码
  7. 【Android代码片段之三】TabActivity实现多页显示效果
  8. Android 项目代码混淆

随机推荐

  1. Android(Java):HTTP协议
  2. 将Android(安卓)SQLite db 文件转化成xml
  3. Android(安卓)之 远程图片获取和本地缓存
  4. Android(安卓)Animation Tween动画效果的
  5. Android(安卓)Service 弹出系统全局Dialo
  6. Android:Textview 通过代码设置 Drawable
  7. 使用RecyclerView加载不出数据的原因可能
  8. webservice android 设置head头发送 获取
  9. Android(安卓)Service用法总结和生命周期
  10. Android(安卓)单元测试