アンドロイドのアプリ作成を始めています。
初歩中の初歩で申し訳ないのですが、2つあるうちの下のImageViewに正しくandroid:layout_belowが効かないです。
なにをどうやれば、上のImageViewと被らずにandroid:belowが効きますか?
layout:marginTopとかは使わない前提です
xml
1<!-- TODO: この LinearLayout の子 View が、横方向の真ん中に来るようにする --> 2<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 xmlns:tools="http://schemas.android.com/tools" 4 android:layout_width="match_parent" 5 android:layout_height="match_parent" 6 android:orientation="vertical" 7 android:paddingBottom="@dimen/activity_vertical_margin" 8 android:paddingLeft="@dimen/activity_horizontal_margin" 9 android:paddingRight="@dimen/activity_horizontal_margin" 10 android:paddingTop="@dimen/activity_vertical_margin" 11 tools:context=".MainActivity"> 12 13 <RelativeLayout 14 android:layout_width="match_parent" 15 android:layout_height="wrap_content"> 16 17 <FrameLayout 18 android:id="@+id/image" 19 android:layout_width="wrap_content" 20 android:layout_height="wrap_content" 21 android:layout_centerInParent="true"> 22 23 <RelativeLayout 24 android:layout_width="match_parent" 25 android:layout_height="match_parent"> 26 27 <ImageView 28 android:layout_width="wrap_content" 29 android:layout_height="wrap_content" 30 android:src="@drawable/ic_launcher" 31 android:layout_centerHorizontal="true" /> 32 33 </RelativeLayout> 34 35 <TextView 36 android:layout_width="wrap_content" 37 android:layout_height="wrap_content" 38 android:text="@string/hello_world" 39 android:paddingTop="10dp"/> 40 41 </FrameLayout> 42 43 <FrameLayout 44 android:layout_below="@+id/image" <!--ここのlayout_belowが効かない--> 45 android:layout_width="wrap_content" 46 android:layout_height="wrap_content" 47 android:layout_centerHorizontal="true"> 48 49 <ImageView 50 android:layout_width="wrap_content" 51 android:layout_height="wrap_content" 52 android:src="@drawable/ic_launcher" /> 53 </FrameLayout> 54 </RelativeLayout> 55</LinearLayout>
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。