• fresco xml配置属性不起作用


    在xml中配置加载等待图标,不起作用。

    正确的如下:

     1 <?xml version="1.0" encoding="utf-8"?>
     2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     3     xmlns:fresco="http://schemas.android.com/apk/res-auto"  //注意这行代码,之前就是因为写成tools不起作用
     4     android:id="@+id/linear_create_adver"
     5     android:layout_width="match_parent"
     6     android:layout_height="match_parent"
     7     android:background="@color/bg_activity"
     8     android:orientation="vertical">
     9 
    10     <com.facebook.drawee.view.SimpleDraweeView
    11                     android:id="@+id/iv_adver_pic"
    12                     android:layout_width="150dp"
    13                     android:layout_height="match_parent"
    14                     android:layout_marginTop="5dp"
    15                     android:layout_marginBottom="5dp"
    16                     android:layout_marginRight="10dp"
    17                     fresco:progressBarImage="@drawable/loading"
    18                     fresco:progressBarAutoRotateInterval="1000"
    19                     fresco:progressBarImageScaleType="center"
    20                     fresco:actualImageScaleType="fitXY"/>
    21 </LinearLayout>

    java代码中设置:

    1 DraweeController controller = Fresco.newDraweeControllerBuilder()
    2                         .setUri(GlobalParams.gInitInfoEntity.getModel().getImage_url() + mAdverPicUrl)
    3                         .setTapToRetryEnabled(true)
    4                         .setOldController(ivAdverPic.getController())
    5                         .build();
    6                 ivAdverPic.setController(controller);
  • 相关阅读:
    hadoop3.2.0集群搭建的一些坑!
    springboot整合elasticJob实战(纯代码开发三种任务类型用法)以及分片系统,事件追踪详解
    Flask接口返回JSON格式数据自动解析
    Struts2--国际化
    Struts2--标签tag
    Struts2-OGNL
    Struts2--拦截器Interceptor
    Struts2--struts.xml详解
    Spring--事务管理
    Spring--JDBC
  • 原文地址:https://www.cnblogs.com/feijian/p/6406719.html
Copyright © 2020-2023  润新知