(1) If we use multiple textview, we will squeeze together as follows:
The corresponding code is as follows:
<linearlayoutandroid:layout_width="Wrap_content"android:layout_height ="40DP" > <textview android:la Yout_width = "40DP" android:layout_height = "40DP" android:text = "name" android:textsize = "20 SP "/> <textview android:la Yout_width = "40DP" android:layout_height = "40DP" android:text = "gender" android:textsize = "20 SP "/> <TextViewandroid:layout_width= "40dp"android:layout_height="40DP "android:text="age "android:textsize=" 20sp " /> </linearlayout>
(2) How to solve the problem? is to add a view between the following code:
<linearlayoutandroid:layout_width="Wrap_content"android:layout_ Height="40DP" > <TextViewandroid:layout_width= "40dp"android:layout_height="40DP "android:text=" name "android:textsize=" 20sp " /> <Viewandroid:layout_width="Wrap_content"android:layout_height ="1DP"android:layout_weight="1" /> <TextViewandroid:layout_width= "40dp"android:layout_height="40DP "android:text=" Gender "android:textsize=" 20sp " /> <Viewandroid:layout_width="Wrap_content"android:layout_height ="1DP"android:layout_weight="1" /> <TextViewandroid:layout_width= "40dp"android:layout_height="40DP "android:text="age "android:textsize=" 20sp " /> </linearlayout>
The effect is as follows: it's getting pretty.
The note of the other value is:
<View android:layout_width="wrap_content" android:layout_height="1dp" android:layout_weight="1" />
The use of the view must have a wide, high setting, otherwise it will run error!
How to use view padding between multiple textview to make space between Android