I am trying to recrate following layout in android studio:
Because i am preety new at android stuff, i first tryed with LinearLayout, and figured thath this probably wont be possible with it. Now i am trying with RelativeLayout i already created this block with color:
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="80dp"
android:background="@color/red_top">
</RelativeLayout>
Now i want to ask how can i divide it like it is shown at the image 1 bar at top and 2 at the bottom in the same layout, and how can i put same borders?
You can do this by using the following xml code:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/custom_toast_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#CD96CD"
android:text="TEXT" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#000000" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:background="#CD96CD"
android:text="TEXT" />
<View
android:layout_width="1dp"
android:layout_height="fill_parent"
android:background="#000000" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:background="#CD96CD"
android:text="TEXT" />
</LinearLayout>
</LinearLayout>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With