url to try
solution
- layout_weight
- 0dp for width and height
code
here ,this is the solution
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:text="Six"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1"
android:textSize="24sp" />
<TextView
android:text="Sam"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1"
android:textSize="24sp" />
<TextView
android:text="Seat"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1"
android:textSize="24sp" />
</LinearLayout>
result screen-cap

application

hangout

maps app

practise

conlusion
1b任务一共有接近23个video,当前看完第13个
have a rest

本文介绍了一种使用布局权重(layout_weight)实现等宽布局的方法。通过设置LinearLayout内TextView的宽度和高度为0dp,并赋予相同的权重,使得三个TextView能够平均分配空间。此技巧适用于Android应用开发中需要动态调整视图大小的场景。

2917

被折叠的 条评论
为什么被折叠?



