欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

android 线性布局 底部,java – 如何在android线性布局中对齐父底部?

发布时间:2025/4/16 编程问答 44 豆豆
生活随笔 收集整理的这篇文章主要介绍了 android 线性布局 底部,java – 如何在android线性布局中对齐父底部? 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

我有一个线性布局

我想在它的底部创建一个切片.

我知道有一些选择,但我有点困惑

1)android:layout_gravity:“bottom” – >由于某种原因,这对我不起作用.

2)android:gravity_weight =“0”并给它之前的兄弟:android:gravity_weight:“1”

3)android:height =“wrap_content”并给它之前的兄弟:android:height:“match_parent”

我知道如何使用relativeLayout执行此操作,但我想练习linearLayout

你会建议什么?

android:layout_width="match_parent"

android:layout_height="match_parent"

android:background="@color/blue_bg"

android:orientation="vertical" >

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:layout_marginBottom="10dp"

android:layout_marginTop="5dp"

android:src="@drawable/signup_illu_why" />

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:layout_weight=""

android:orientation="horizontal" />

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:src="@drawable/signup_skip_icon" />

总结

以上是生活随笔为你收集整理的android 线性布局 底部,java – 如何在android线性布局中对齐父底部?的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。