PowenKo, android, Tutorial 020-4, Layout, include other layout

August 17, 2011   ·   0 Comments

Result:

add a res\layout\title.xml


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

    <!--   // the views to be merged -->
	 <Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>

</merge>

update relayout\main.xml


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

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

android:orientation="vertical"

android:layout_width="fill_parent"

android:layout_height="fill_parent"

>

<!--   // some views-->

<include layout="@layout/title"/>

<!--    // probably more views-->

<TextView

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:text="@string/hello"

/>

</LinearLayout>

</code>

sample code:

"Tutorial_UI_LinearLayout_includeActivity"
shareShare on FacebookShare on Google+Share on LinkedInEmail this to someonePrint this pageBuffer this pageDigg thisFlattr the authorShare on RedditPin on PinterestShare on StumbleUponShare on TumblrTweet about this on Twitter

By


Readers Comments (0)


You must be logged in to post a comment.

PowenKo’s Online Store

powenko_arduinoBook
Android7

Amazon

adsbygoogle

Recent Posts

Categories

Amazon