我使用从这里的烂番茄示例应用程序:Rotten Tomatoes sample app。Android图片不显示全尺寸
但电影海报图像在手机上并未显示完整大小。布局宽度和高度属性都设置为“wrap_content”,但图像显示缩小。我必须设置宽度和高度的实际像素大小,以便它们正确显示。我不知道为什么会发生这种情况。
不起作用:
<ImageView
android:id="@+id/ivPosterImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:src="@drawable/large_movie_poster" />
是否工作:
<ImageView
android:id="@+id/ivPosterImage"
android:layout_width="121dp"
android:layout_height="179dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:src="@drawable/large_movie_poster" />
我假设你下载每个图像。下载它们之后,您是否将图像设置为imageview? – ezcoding
是的,那是对的。 – Mike
我认为imageview具有可绘制源的大小,并且当您将新图像应用于它时,imageview的大小不会更改,因为它的大小已经被计算出来 – ezcoding