android - TextViews with dividers in between them -


i trying recrate following layout in android studio:

preview image

because preety new @ android stuff, first tryed linearlayout, , figured thath wont possible it. trying relativelayout created block color:

        <relativelayout                 android:layout_width="fill_parent"                 android:layout_height="80dp"                 android:background="@color/red_top">         </relativelayout> 

now want ask how can divide shown @ image 1 bar @ top , 2 @ bottom in same layout, , how can put same borders?

you can using 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> 

Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -