【发布时间】:2015-11-26 22:39:40
【问题描述】:
我正在使用 Glide 壁纸应用程序 我用 glide 加载图像并在 imageview 中显示,但是加载后的图像在 imageview 的顶部。
我怎样才能解决这个问题并将其置于 imageview 的中心?
代码:
Glide.with(this)
.load(data)
.fitCenter()
.into(wallpaper);
XML:
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/img_aksneveshte"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true" />
【问题讨论】:
-
请输入您的xml代码
-
您确定您的
ImageView横跨整个屏幕高度吗?另外,请仔细检查您没有启用类似adjustViewBounds的功能。按照建议,如果您添加相关布局文件的内容,我们可以提供更多帮助。 -
我更新了帖子。 adjustViewBounds 不起作用
标签: android android-imageview android-glide