【发布时间】:2017-08-07 14:20:39
【问题描述】:
我正在使用 Glide 4.0 将图像加载到具有 scaleType="matrix" 的 ImageView 中,以实现平移和缩放功能。图像未居中加载。如果它很高,则加载到左侧,如果它很宽,则加载到顶部(见图)。我已经尝试了各种 RequestOptions,但最初都没有将图像居中。我怎样才能做到这一点?谢谢!
Current Tall or Wide Image Position
活动
Uri selectedImage = returnedIntent.getData();
RequestOptions options = new RequestOptions().fitCenter();
Glide.with(MyActivity.this).load(selectedImage).apply(options).into(mImage);
布局
<ImageView
android:id="@+id/m_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="matrix" />
【问题讨论】:
-
请在您的问题中添加代码 sn-p
-
@Danilo 更新了!谢谢!
标签: android imageview android-glide