画面の横幅より大きな画像は表示されない?
実は、入り組んだレイアウトでなく、単純にこんなレイアウトにしても画像は表示されない。
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity" > <ImageView android:id="@+id/listViewSplashImage" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:contentDescription="@string/splash_image" android:scaleType="centerInside" android:src="@drawable/splash_image" /> </RelativeLayout>
もうどうして良いのかわからない…。
で、あれこれやってたら、表示しようとする画像の横幅が画面のサイズより小さいと表示できることを発見。
え〜?
本当にそれが原因なのかな〜?
そんなんが原因なら Webで情報が見つかりそうだけど…。
(画像サイズが大き過ぎてメモリエラーが起きてるとかかな?)
そんなわけで、今回は根本的に画像を表示できなかったので xmlだけでやるのは諦めた!