自动居中裁剪的ImageView的Andr​​oid如何? [英] How to auto center crop ImageView Android?

查看:181
本文介绍了自动居中裁剪的ImageView的Andr​​oid如何?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了一个列表视图图像。我的目标是我的ListView的每个项目具有100dp的相同的高度。我遇到了我的ImageView会自动调整大小的问题,但没有考虑父母的整个空间。

I made a listView images. My goal that each item of my listView have the same height of 100dp. I encounter a problem that my imageView is resized automatically, but does not take the entire space of the parent.

这是我目前的结果,并OBJECTIF结果:

有谁知道选项添加到自动使作物中心?

推荐答案

我不知道如果我理解正确的。它必须是两人的,你想要的,我想。

I am not sure if I understood correctly. It must be either of the two, that you want, I guess.

在你的图像视图设置属性

In your image view set the attribute

android:scaleType="fitXY"

要适应的ImageView 完全

您可以选择

android:scaleType="centerCrop"

裁剪中心。

这篇关于自动居中裁剪的ImageView的Andr​​oid如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆