展会信息港展会大全

Android ApiDemos示例解析(138):Views->Layouts->Baseline->6. Relative
来源:互联网   发布日期:2015-10-13 17:07:46   浏览:2292次  

导读:本例将一个TextView 和父RelativeLayout 左,上对齐,然后就另一个View和它设置baseline对齐:<RelativeLayout xmlns:android=”ht...

本例将一个TextView 和父RelativeLayout 左,上对齐,然后就另一个View和它设置baseline对齐:

<RelativeLayout xmlns:android=”http://schemas.android.com/apk/res/android”

android:layout_width=”match_parent”

android:layout_height=”match_parent”>

<TextView android:id=”@+id/anchor”

android:layout_width=”wrap_content”

android:layout_height=”wrap_content”

android:layout_alignParentTop=”true”

android:layout_alignParentLeft=”true”

android:textStyle=”bold”

android:text=”@string/baseline_7_fat” />

<TextView

android:layout_width=”wrap_content”

android:layout_alignParentRight=”true”

android:layout_alignBaseline=”@id/anchor”

android:layout_height=”wrap_content”

android:text=”@string/baseline_7_lean” />

</RelativeLayout>

赞助本站

人工智能实验室

相关热词: android开发 教程

AiLab云推荐
推荐内容
展开

热门栏目HotCates

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