gpt4 book ai didi

android - Fixed Size ImageView 显示不同大小的图像

转载 作者:行者123 更新时间:2023-11-30 01:43:33 26 4
gpt4 key购买 nike

我正在开发一个应用程序,我必须从服务器下载图像,在服务器上我有不同形式的图像。像 jpeg,png.

我正在使用 volley 下载我的图片

<com.android.volley.toolbox.NetworkImageView
android:layout_marginLeft="5dp"
android:layout_width="65dp"
android:layout_height="65dp"
android:id="@+id/main_profile_image"
android:layout_gravity="center_vertical"
android:scaleType="fitCenter"
android:background="#eeeeee"
android:layout_centerInParent="true" />

但我的结果是有形式的 Screen Shot如何修复它。有什么帮助吗?

最佳答案

试试这个会有帮助

android:scaleType="centerInside"
android:adjustViewBounds="true"

因为 scaleType="fitCenter" 在您省略时默认为

参见 this

关于android - Fixed Size ImageView 显示不同大小的图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34083527/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com