展会信息港展会大全

android开发之 RelativeLayout+include layout的属性
来源:互联网   发布日期:2015-10-13 14:58:04   浏览:4430次  

导读:?xml version=1 0 encoding=utf-8?LinearLayout xmlns:android=http: schemas android com apk res android android:orientation=vertical android:layout_width=wrap_conten ...

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

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

android:orientation="vertical"

android:layout_width="wrap_content"

android:layout_height="wrap_content">

<TextView android:id="@+id/textview"

android:layout_height="wrap_content"

android:layout_width="wrap_content"/>

</LinearLayout>

<!-- lang: xml -->

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

xmlns:tools="http://schemas.android.com/tools"

android:id="@+id/layout_main"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:paddingLeft="@dimen/activity_horizontal_margin"

android:paddingRight="@dimen/activity_horizontal_margin"

android:paddingTop="@dimen/activity_vertical_margin"

android:paddingBottom="@dimen/activity_vertical_margin"

tools:context=".MainActivity"

android:background="@drawable/splash">

<include android:id="@+id/sv"

layout="@layout/subview"

android:layout_height="wrap_content"

android:layout_width="wrap_content"

android:layout_marginLeft="80dp"/>

<include android:id="@+id/sv1"

android:layout_height="wrap_content"

android:layout_width="wrap_content"

layout="@layout/subview"

android:layout_below="@id/sv"/>

这里在include的时候需要覆盖 android:layout_height和 android:layout_width属性,否则所有其他关于layout的属性设置都会被忽略掉。

参考:http://stackoverflow.com/questions/2316465/how-to-get-relativelayout- working-with-merge-and-include

赞助本站

人工智能实验室

相关热词: RelativeLayout include 属性 andr

AiLab云推荐
推荐内容
展开

热门栏目HotCates

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