Nag*_*ddy 3 android custom-view
我有自定义视图,我想在xml文件中添加我尝试这样但我收到此错误
Custom view TouchImageView is not using the 2- or 3-argument View constructors;
XML attributes will not work
Run Code Online (Sandbox Code Playgroud)
这是我正在使用的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>
Run Code Online (Sandbox Code Playgroud)
Sha*_*wat 16
添加构造函数:
public TouchImageView(Context context, AttributeSet attributeSet)
{
super(context, attributeSet);
//TODO:
}
Run Code Online (Sandbox Code Playgroud)
到您的自定义View类.
| 归档时间: |
|
| 查看次数: |
4319 次 |
| 最近记录: |