列表视图来显示图像的android [英] listview to display images in android
本文介绍了列表视图来显示图像的android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个Android的ListView和我在它的ImageView
I have a listview in android and i have a imageview in it
我填充图像到列表视图我有一个输出像下面:
I am populating images into the list view i have a output like below::
listview_item.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:descendantFocusability="blocksDescendants" >
<ImageView
android:id="@+id/flag"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:src="@drawable/ic_launcher" />
</RelativeLayout>
我怎么能做出这样的事情低于
How can i make something like this below
任何想法! ...我想在列表视图来实现这一
Any ideas ! ... i am trying to achieve this in list view
推荐答案
SET 的android:adjustViewBounds =真正的
XML或属性 ImageView的。 setAdjustViewBounds(真)
Java编写的。
SET android:adjustViewBounds="true"
attribute in xml or imageView.setAdjustViewBounds(true)
in Java.
同时
您可以使用 的android:scaleType =fitXY
在XML:
You can use android:scaleType="fitXY"
in XML:
<ImageView
android:id="@+id/flag"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:scaleType="fitXY"
android:src="@drawable/ic_launcher" />
这篇关于列表视图来显示图像的android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文