android-3种布局-中间很灵活

android-3种布局-中间很灵活,第1张

概述我需要以下东西:3种布局:>标题>内容>页脚标头必须位于顶部,标头必须底部(android:layout_alignParentBottom=“true”).但是如何使中间画面占据整个其他画面呢?谢谢.解决方法:这是我的解决方案(使用android:layout_weight和ScrollView):<LinearLayoutxmlns:android="http://sch

我需要以下东西:

3种布局:

>标题
>内容
>页脚

标头必须位于顶部,标头必须底部(android:layout_alignParentBottom =“ true”).

但是如何使中间画面占据整个其他画面呢?谢谢.

解决方法:

这是我的解决方案(使用androID:layout_weight和ScrollVIEw):

<linearLayout xmlns:androID="http://schemas.androID.com/apk/res/androID"xmlns:tools="http://schemas.androID.com/tools"androID:layout_wIDth="fill_parent"androID:layout_height="fill_parent"androID:orIEntation="vertical" ><linearLayout    androID:layout_wIDth="match_parent"    androID:layout_height="wrap_content"    androID:layout_weight="1"    androID:background="#ddddDD"    androID:gravity="center"    androID:orIEntation="vertical" >    <TextVIEw        androID:layout_wIDth="wrap_content"        androID:layout_height="wrap_content"        androID:text="header"        tools:ignore="HardcodedText" /></linearLayout><ScrollVIEw    androID:layout_wIDth="match_parent"    androID:layout_height="wrap_content"    androID:layout_weight="3" >    <TextVIEw        androID:layout_wIDth="wrap_content"        androID:layout_height="wrap_content"        androID:layout_gravity="center"        androID:text="Content"        tools:ignore="HardcodedText" /></ScrollVIEw><linearLayout    androID:layout_wIDth="match_parent"    androID:layout_height="wrap_content"    androID:layout_weight="1"    androID:background="#ddddDD"    androID:gravity="center"    androID:orIEntation="vertical" >    <TextVIEw        androID:layout_wIDth="wrap_content"        androID:layout_height="wrap_content"        androID:text="Footer"        tools:ignore="HardcodedText" /></linearLayout></linearLayout>

和结果图片:

总结

以上是内存溢出为你收集整理的android-3种布局-中间很灵活全部内容,希望文章能够帮你解决android-3种布局-中间很灵活所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1086722.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-27
下一篇 2022-05-27

发表评论

登录后才能评论

评论列表(0条)

保存