I've created a simple LinearLayout
with three identical elements:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Hello"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Hello"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Hello"/>
</LinearLayout>
Now I'm going to introduce 8dp
space between each pair of elements.
Which solution of the ones below are considered as cleaner?
or maybe some another?
TextView
in some custom class in the future, and you can embed that in the class. Or you might want to create astyle
resource for thatTextView
and define margins in thestyle
. – Lip