Adding a Line Separator between two TextViews in Android XML



Recently I started practicing Android Development and I am stuck at a very basic problem. Since I am a beginner in this field, I am asking for your help.



<LinearLayout
xmlns:android="http://ift.tt/nIICcg"
xmlns:tools="http://ift.tt/LrGmb4"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".MainActivity">

<TextView
android:text="Name1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:textSize="18sp"

/>

<EditText
android:id="@+id/player_name"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_weight="@integer/abc_max_action_buttons"
/>

<TextView
android:text="Name2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:textSize="18sp"

/>
<EditText
android:id="@+id/player_name"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_weight="@integer/abc_max_action_buttons"
/>




</LinearLayout>


In this XML scheme, I am trying to put a text followed by text-space and repeating it again. e.g. Name1 ___________________ //Next Line// Name2 ___________________


But the problem is that Name2 is not going into the next line and staying in the same line . Please tell me how to fix it.


Thanks in advance


No comments:

Post a Comment