2011-12-02 46 views
3

我已經customview,我想補充的是,在xml文件我想這樣的,但我得到這個錯誤錯誤在創建自定義視圖的

Custom view TouchImageView is not using the 2- or 3-argument View constructors; 
    XML attributes will not work 

這是我使用的XML ..

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:orientation="vertical" > 

<view 
    class="com.zoom.TouchImageView" 
    android:id="@+id/webView1" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" /> 

</LinearLayout> 
+0

認罪澄清你的問題.. –

+0

@AwaisTariq我在XML圖形佈局正在逐漸.. – NagarjunaReddy

回答

16

構造地址:

public TouchImageView(Context context, AttributeSet attributeSet) 
{ 
    super(context, attributeSet); 

    //TODO: 
} 

您的自定義視圖類。