私はここで言及したこのソリューションを使用しようとしていた縦半分に私の画面を分割し、各半分に異なる色を行い、2つの相対レイアウトをアクティビティで半分に分割する方法は?
したい>
Android: 2 relative layout divided in half screen
が、それはしていません私のために働く。
これは私のレイアウトです:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
android:baselineAligned="false"
android:orientation="horizontal"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context=".activities.alignmentActivities.Add_New_Project_Activity"
tools:showIn="@layout/app_bar_add__new__project_">
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="#f00000"
android:layout_weight="1">
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:background="#00b0f0"
android:layout_height="wrap_content"
android:layout_weight="1">
</RelativeLayout>
</LinearLayout>
どのように私は、2つのレイアウトの所望の効果を達成することができ、それぞれが縦画面の半分を取る\私は、間違ったリンクに記載された例を何をやっていますか?
変更 'アンドロイドとして、その値を変更します。layout_heightは=「wrap_content」' 'match_parent'へ – Marat
画面を縦に分割しますか? –
このリンクを参照してくださいhttp://stackoverflow.com/questions/4961355/percentage-width-in-a-relativelayout/32168421#32168421 –