问一下android xml

时间:2013-02-26 16:21:09

标签: android xml

我下载示例android应用程序

然后将xml ini文件放在

下面
<?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="horizontal" >

    <net.example.view
        android:id="@+id/view"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_weight="10" />

    <TextView
        android:id="@+id/text"
        android:layout_width="fill_parent"
        android:layout_height="346dp"
        android:layout_weight="79.81"
        android:gravity="center_horizontal|center_vertical"
        android:text=""
        android:textSize="16pt" />

</LinearLayout>

我想问一下这个xml

 <net.example.view
       android:id="@+id/view"
       android:layout_width="fill_parent"
       android:layout_height="fill_parent"
       android:layout_weight="10" />

上面的xml意味着什么目的?

1 个答案:

答案 0 :(得分:2)

这是一个自定义视图。

自定义视图可以在扩展现有View的Java类中定义,然后可以在布局XML中使用。

您可以在Android开发者指南的Creating Custom Views部分中详细了解这些内容(并了解如何创建自己的内容)。

相关问题