简体   繁体   English

圆形图像视图显示方形图像

[英]Circle Image View shows square images

I want to add a list of circleimageview and text view and use it in the recycler view but it shows me square shape images like this but I want to show a rounded image我想添加一个 circleimageview 和文本视图的列表并在回收器视图中使用它,但它向我显示了像这样的方形图像,但我想显示一个圆形图像在此处输入图像描述

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:orientation="horizontal"
    android:padding="16dp"
    android:background="@drawable/category_bg"
    android:layout_margin="4dp"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <de.hdodenhof.circleimageview.CircleImageView
        android:id="@+id/image_view"
        android:layout_width="70dp"
        android:layout_height="70dp"
        android:src="@color/purple_200" />
        <TextView
        android:id="@+id/title"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_marginStart="8dp"
        android:layout_marginEnd="8dp"
        android:layout_weight="1"
        android:text="Title"
        android:textColor="@color/black"
        android:textStyle="bold"
        android:textSize="18sp"
        android:gravity="center_vertical"
        android:padding="8dp"
        />

</LinearLayout>

also, I have added the dependencies for circle image view另外,我添加了圆形图像视图的依赖项

implementation 'de.hdodenhof:circleimageview:3.1.0'

help Me to find an error in this code帮我找出这段代码中的错误

Please rebuild your project and sure that its implementation in build.gradle successfully added to the project:请重建您的项目并确保其在 build.gradle 中的实现已成功添加到项目中:

在此处输入图像描述

Rebuild your project and make sure before rebuild your build.gradle successfully added to the project.重建您的项目并确保在重建之前您的 build.gradle 已成功添加到项目中。 and also clear cache for your project after that it working properly并在项目正常工作后清除缓存

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM