-1

To create this UI would it be best to use a simple list view or to create a view with a line as the background? I am unsure as to what would be the proper way of doing this. enter image description here

Samuel
  • 17
  • 1
  • 5

2 Answers2

0

A ListView would make your code more maintainable, but if it's just static elements on the screen and you're sure you're not going to add anything, you could definitely use a simple View. i use LinearLayouts for underlines like those.

 <LinearLayout
        android:id="@+id/divider1"
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:layout_below="@+id/title1"
        android:layout_marginTop="5dp"
        android:background="#52525252"
        android:orientation="horizontal"></LinearLayout>
eiran
  • 1,378
  • 15
  • 16
  • Using a LinearLayout isn't great for performance, better to just use a `View`: https://stackoverflow.com/questions/5049852/android-drawing-separator-divider-line-in-layout – Daniel Nugent Nov 08 '19 at 20:46
  • You can use View or Horizontal deivider widget for create divider line –  Nov 09 '19 at 05:19
0

This is a best way to add static underline ,Use View to add static underline

Add this Code:

          <View
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:layout_marginTop="5dp"
            android:background="#52525252"/>

screen shot

Android Geek
  • 8,956
  • 2
  • 21
  • 35