item当中的布局
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:layout_margin="10dp"
android:id="@+id/testimage"
android:layout_width="match_parent"
**android:layout_height="match_parent"**
android:src="@drawable/addphoto"
/>
</RelativeLayout>
发现当ImageView的高度设置为match_parent的时候死活显示不出来。自己设置一个高度或者是使用wrap_content就可以了
本文探讨了在Android开发中,ImageView设置高度为match_parent时显示异常的问题。通过对比不同高度属性设置的效果,指出使用wrap_content或其他固定高度可以有效解决此问题。
650

被折叠的 条评论
为什么被折叠?



