2013-02-26 61 views
0

我是下載例如Android應用程序問關於Android XML

那麼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高於平均和目的是什麼?

回答

2

這是一個自定義視圖。

自定義視圖可以在擴展現有視圖的Java類中定義,然後可以在佈局XML中使用。

您可以在Android Developers指南的Creating Custom Views部分閱讀更多關於它們(並學習如何創建自己的內容)。