android– 我在Fresco中遇到圆形图像问题

android– 我在Fresco中遇到圆形图像问题,第1张

概述我有圆形图像的问题,不起作用,壁画下载图像和显示但不转换为圆形.我不知道我错过了这是我的代码.摇篮:applyplugin:'com.android.application'android{compileSdkVersion24buildToolsVersion"25.0.0"defaultConfig{applicationId"pruebas.imaginamo

我有圆形图像的问题,不起作用,壁画下载图像和显示但不转换为圆形.我不知道我错过了这是我的代码.

摇篮:

apply plugin: 'com.androID.application'androID {    compileSdkVersion 24    buildToolsversion "25.0.0"    defaultConfig {    applicationID "pruebas.imaginamos.com.pruebas"    minSdkVersion 21    targetSdkVersion 24    versionCode 1    versionname "1.0"    testInstrumentationRunner     "androID.support.test.runner.AndroIDJUnitRunner"    }    buildTypes {        release {            MinifyEnabled false            proguardfiles getDefaultProguardfile('proguard-androID.txt'), 'proguard-rules.pro'    }}}dependencIEs {    compile filetree(dir: 'libs', include: ['*.jar'])    androIDTestCompile('com.androID.support.test.espresso:espresso-core:2.2.2', {    exclude group: 'com.androID.support', module: 'support-annotations'})    compile 'com.androID.support:appcompat-v7:24.2.1'    compile 'com.facebook.fresco:fresco:0.14.1'    testCompile 'junit:junit:4.12'   //compile 'com.mostafagazar:customshapeimagevIEw:1.0.4'   // If your app supports AndroID versions before Ice Cream SanDWich (API level 14)   compile 'com.facebook.fresco:animated-base-support:0.14.1'}

这是MainActivity5.java:

package pruebas.imaginamos.com.pruebas;import androID.net.Uri;import androID.os.Bundle;import androID.support.v7.app.AppCompatActivity;import com.facebook.drawee.vIEw.SimpleDraweeVIEw;public class MainActivity5 extends AppCompatActivity {   SimpleDraweeVIEw simpleDraweeVIEw;   @OverrIDe   protected voID onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentVIEw(R.layout.activity_main);        String url = "https://firebasestorage.GoogleAPIs.com/v0/b/farmatodo-dev.appspot.com/o/imChat%2F2e4120c7-3755-4537-aceb-c2ed9d97ad01%2F1479745196209-about-06.jpg?alt=media&token=fb0c3c8a-eeac-488b-96d2-51bc7cbd088a";        Uri uri = Uri.parse(url);        simpleDraweeVIEw = (SimpleDraweeVIEw) findVIEwByID(R.ID.avatarImageVIEw);        simpleDraweeVIEw.setimageURI(uri);}

}

这是activity_main.xml

<?xml version="1.0" enCoding="utf-8"?><linearLayout xmlns:androID="http://schemas.androID.com/apk/res/androID"xmlns:tools="http://schemas.androID.com/tools"xmlns:fresco="http://schemas.androID.com/tools"androID:ID="@+ID/activity_main"androID:orIEntation="vertical"androID:layout_wIDth="match_parent"androID:layout_height="match_parent"androID:paddingBottom="@dimen/activity_vertical_margin"androID:paddingleft="@dimen/activity_horizontal_margin"androID:paddingRight="@dimen/activity_horizontal_margin"androID:paddingtop="@dimen/activity_vertical_margin"tools:context="pruebas.imaginamos.com.pruebas.MainActivity5"><relativeLayout    androID:layout_wIDth="match_parent"    androID:background="@color/colorAccentlight"    androID:layout_height="wrap_content">    <com.facebook.drawee.vIEw.SimpleDraweeVIEw        androID:ID="@+ID/avatarImageVIEw"        androID:layout_wIDth="100dp"        androID:layout_height="100dp"        fresco:placeholderImageScaleType="centerCrop"        fresco:placeholderImage="@drawable/photo_female_3"        fresco:roundAsCircle="true"/></relativeLayout></linearLayout>

解决方法:

替换此行,

xmlns:fresco="http://schemas.androID.com/tools"

在xml文件中使用此行,

xmlns:fresco="http://schemas.androID.com/apk/res-auto"
总结

以上是内存溢出为你收集整理的android – 我在Fresco中遇到圆形图像问题全部内容,希望文章能够帮你解决android – 我在Fresco中遇到圆形图像问题所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1119985.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-29
下一篇2022-05-29

发表评论

登录后才能评论

评论列表(0条)

    保存