今まで表示に使っていたコード
今までは StackOverflowで見つけたこんなコードで動いていた。
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/splashRelativeLayout" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity" > <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_centerInParent="true" android:orientation="horizontal" > <LinearLayout android:layout_width="0dip" android:layout_height="wrap_content" android:orientation="horizontal" android:id="@+id/linearLayout_dummy1" android:layout_weight=".10"> </LinearLayout> <ImageView android:id="@+id/listViewSplashImage" android:layout_width="0dip" android:layout_height="wrap_content" android:layout_weight=".80" android:contentDescription="@string/splash_image" android:scaleType="centerInside" android:src="@drawable/splash_image" /> <LinearLayout android:layout_width="0dip" android:layout_height="wrap_content" android:orientation="horizontal" android:id="@+id/linearLayout_dummy2" android:layout_weight=".10"> </LinearLayout> </LinearLayout> </RelativeLayout>
LinerLayoutで layout_weight使って 0.1/0.8/0.1と並べる方法。
eclipseの画面エディタ?でもちゃんと表示されてる。