android imageloader 和 imageview scaletype
android imageloader and imageview scaletype
我有一个 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:scaleType="centerCrop"
here 你可以阅读更多相关内容
<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:scaleType="centerCrop"
here 你可以阅读更多相关内容