展会信息港展会大全

Android linearLayout 之 layout_weight揭秘
来源:互联网   发布日期:2015-10-13 14:53:25   浏览:1430次  

导读:?xml version=1.0 encoding=utf-8?LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent ......

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:orientation="vertical"

android:layout_gravity="center">

<TextView android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:text="风清扬"

android:gravity="center"

android:layout_weight="1.0"

android:background="@color/blue"/>

<TextView android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:text="无厓子"

android:gravity="center"

android:layout_weight="2.0"/>

<TextView android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:text="令狐冲"

android:gravity="center"

android:layout_weight="3.0"

android:background="@color/red"/>

</LinearLayout>

结果如下图:

赞助本站

人工智能实验室

相关热词: linearLayout layoutweight

相关内容
AiLab云推荐
展开

热门栏目HotCates

Copyright © 2010-2024 AiLab Team. 人工智能实验室 版权所有    关于我们 | 联系我们 | 广告服务 | 公司动态 | 免责声明 | 隐私条款 | 工作机会 | 展会港