Reputation: 667
I have a ListView
where each line has two words. I would like the two words to be align around the center with a small gap.
Similar to (some random words...):
Please Help
me !!
This should
not be
so hard
Each row in the ListView
consists of two TextView
s..
Upvotes: 0
Views: 570
Reputation: 644
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.4"
android:gravity="right" />
<View
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.2"
/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.4"
android:gravity="left" />
</LinearLayout>
Upvotes: 2