質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
Android

Androidは、Google社が開発したスマートフォンやタブレットなど携帯端末向けのプラットフォームです。 カーネル・ミドルウェア・ユーザーインターフェイス・ウェブブラウザ・電話帳などのアプリケーションやソフトウェアをひとつにまとめて構成。 カーネル・ライブラリ・ランタイムはほとんどがC言語/C++、アプリケーションなどはJavaSEのサブセットとAndroid環境で書かれています。

Q&A

解決済

1回答

6064閲覧

layout_belowが効かない

退会済みユーザー

退会済みユーザー

総合スコア0

Android

Androidは、Google社が開発したスマートフォンやタブレットなど携帯端末向けのプラットフォームです。 カーネル・ミドルウェア・ユーザーインターフェイス・ウェブブラウザ・電話帳などのアプリケーションやソフトウェアをひとつにまとめて構成。 カーネル・ライブラリ・ランタイムはほとんどがC言語/C++、アプリケーションなどはJavaSEのサブセットとAndroid環境で書かれています。

0グッド

0クリップ

投稿2017/04/06 13:20

編集2017/04/06 13:27

アンドロイドのアプリ作成を始めています。
初歩中の初歩で申し訳ないのですが、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>

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

imageの中にあるRelativeLayoutにandroid:layout_height="match_parent"が設定されているからだ考えられます。

不要な階層があるのでそれを除去しないとどこが原因かわからないですね。

投稿2017/04/06 14:05

yona

総合スコア18155

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問