首页 > 解决方案 > ShapeableImageView 的笔画被边框切割

问题描述

我在这里有一个 ShapeableImageView,笔画为 5dp:

<com.google.android.material.imageview.ShapeableImageView
    android:id="@+id/profile_picture"
    android:layout_width="100dp"
    android:layout_height="100dp"
    android:layout_marginTop="20dp"
    android:scaleType="centerCrop"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toBottomOf="@id/profile_toolbar"
    app:shapeAppearanceOverlay="@style/circular"
    app:strokeColor="@color/dark_blue"
    app:strokeWidth="5dp" />

这是结果:

这是结果

标签: androidandroid-imageviewstrokeandroid-shape

解决方案


我一直在尝试一些东西,最后,在视图中添加填充解决了问题


推荐阅读