I am trying to make empty lines within android. This is what I have been doing:
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="\n\n"
I want to know if there is a better way? Thanks
I am trying to make empty lines within android. This is what I have been doing:
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="\n\n"
I want to know if there is a better way? Thanks
This can by be achieved by using space or view.
Space is lightweight but not much flexible.
View occupies a rectangular area on the screen and is responsible for drawing and event handling. View is more customizable, you can add background, draw shapes like space.
Implementing Space :
(Eg: Space For 20 vertical and 10 horizontal density pixels)
<Space
android:layout_width="10dp"
android:layout_height="20dp"/>
Implementing View :
(Eg: View For 20 vertical and 10 horizontal density pixels including a background color)
<View
android:layout_width="10dp"
android:layout_height="20dp"
android:background="@color/bg_color"/>
Space for string formatting using HTML entity:
  for non-breakable whitespace.
  for regular space.
Just add weightSum tag to linearlayout to 1 and for the corresponding view beneath it give layout_weight as .9 it will create a space between the views. You can experiment with the values to get appropriate value for you.
Below is the simple way to create blank line with line size. Here we can adjust size of the blank line. Try this one.
<TextView
android:id="@id/textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="5dp"/>