I want to show a TextView
, placed in center of the row, be separated in two or more lines. but I am only able to do
here is my custum_adapter.xml file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent"
android:padding="20dp">
<TextView
android:text="magnitude"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/magnitude"
android:layout_marginLeft="15sp"
android:textSize="20sp"
android:layout_alignParentLeft="true"/>
<TextView
android:text="place"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:inputType="textMultiLine"
android:textSize="20sp"
android:layout_centerHorizontal="true"
android:id="@+id/place" />
<TextView
android:text="date"
android:inputType="textMultiLine"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/date"
android:gravity="center_horizontal"
android:textSize="20sp"
android:layout_marginRight="15sp"
android:layout_alignParentRight="true" />
</RelativeLayout>
I want that my UI should look like the fist image. (I have already seen this these questions 1 , 2, and a few others but none could answer mine)
EDIT: I have asked about formatting the data in a custom ListView
when there are more than two items in a row.