【发布时间】:2015-06-15 08:36:25
【问题描述】:
我有一个 imageview 元素进入 relativelayout 与 textView 像这样
<RelativeLayout>
<ImageView
android:id="@+id/image"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:adjustViewBounds="true"
android:background="@color/darkblue"
android:scaleType="fitXY"/>
<TextView
android:id="@+id/title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/image"
android:paddingBottom="2dp"
android:gravity="bottom"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:textSize="13sp"
android:background="@drawable/gradient"
android:textColor="@color/White"
/>
</RelativeLayout>
我想使用 imageloader 加载图像,但是当我加载图像时,图像的高度并没有填满所有相关布局,我尝试使用 scaletype: fitcenter 仍然无法正常工作,我尝试更改图像的高度以编程方式,但仍未显示所有高度,
image.getLayoutParams().height=(int) (screenWidth/2);
【问题讨论】:
标签: android imageview universal-image-loader