展会信息港展会大全

如何能令Linearlayout中的元素按百分比占据父View
来源:互联网   发布日期:2016-01-14 11:32:28   浏览:1730次  

导读:LinearLayout android:id=@+id/navigation_bar android:background=#f9f9f9 android:orientation=horizontal android:layout_alignParentBottom=true android:layout_width=match_parent android:layout_height=50dp ImageView android:layout_weight=1 !--...

<LinearLayout

android:id="@+id/navigation_bar"

android:background="#f9f9f9"

android:orientation="horizontal"

android:layout_alignParentBottom="true"

android:layout_width="match_parent"

android:layout_height="50dp">

<ImageView

android:layout_weight="1"<!-- 占据1/(1+1+1) -->

android:layout_width="0dp"

android:layout_height="match_parent"/>

<ImageView

android:layout_weight="1" <!-- weight每个元素所占的权重 -->

android:layout_width="0dp"

android:layout_height="match_parent"/>

<ImageView

android:layout_weight="1"

android:layout_width="0dp"

android:layout_height="match_parent"/>

</RelativeLayout>

</LinearLayout>

赞助本站

人工智能实验室

相关热词: android开发 android教程

AiLab云推荐
展开

热门栏目HotCates

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