2016-11-24 16 views
0

6ヶ月前にアプリを開発しましたが、今更新しようとしています。 (Androidスタジオが更新されました)。私は新しいアクティビティを作成し、下に2つのレイアウトを配置しようとしました(これは相対的なレイアウトまたは線形です)が動作しません。私は私の古いプロジェクトをチェックします。私は親プロパティの塗りつぶしを使用しましたが、更新のために今は使用できません。Android 2つのレイアウトを下に配置する方法は?

enter image description here

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:id="@+id/content_launcer_screen" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    app:layout_behavior="@string/appbar_scrolling_view_behavior" 
    tools:showIn="@layout/app_bar_launcer_screen" 
    android:elevation="1dp"> 

    <RelativeLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"> 

     <LinearLayout 
      android:orientation="vertical" 
      android:layout_width="match_parent" 
      android:layout_height="150dp"></LinearLayout> 

     <LinearLayout 
      android:orientation="vertical" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_below="@+id/linearLayout6"></LinearLayout> 
    </RelativeLayout> 
</RelativeLayout> 
+0

を削除してくださいあなたはmatch_parent意味しますか? – Rippr

+0

コードを入力してください –

+0

私はいくつかのコードを追加しました。 – user2265473

答えて

0

あなたがapp:layout_behavior="@string/appbar_scrolling_view_behavior"を使用しているであるこの

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 

<LinearLayout 
    android:layout_weight="1" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 


</LinearLayout> 

<LinearLayout 
    android:layout_weight="0.5" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 


</LinearLayout> 

</LinearLayout> 
+0

申し訳ありませんが動作しません。 – user2265473

+0

正確に何が必要ですか? –

+0

これは、画像3で示したのと同じ方法でレイアウトを作成します。 –

0

理由は、この

<RelativeLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"> 

     <LinearLayout 
      android:id="@+id/ll_first" 
      android:orientation="vertical" 
      android:layout_width="match_parent" 
      android:layout_height="150dp"> 

     </LinearLayout> 

     <LinearLayout 
      android:orientation="vertical" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_below="@+id/ll_first"> 

     </LinearLayout> 
    </RelativeLayout> 
関連する問題