xml:
<com.lyx.SingleWeatherInfoView android:id="@+id/weather_0"android:layout_width="wrap_content" android:layout_height="wrap_content"
/>java代码
package com.lyx;import android.content.Context;
import android.widget.LinearLayout;public class SingleWeatherInfoView extends LinearLayout
{ public SingleWeatherInfoView(Context context)
{
super(context);
// TODO Auto-generated constructor stub
}}
在XML中写了
<com.lyx.SingleWeatherInfoView android:id="@+id/weather_0"android:layout_width="wrap_content" android:layout_height="wrap_content"
/>
SingleWeatherInfoView 是类名。顺着意思我又建了个SingleWeatherInfoView并继承了LinearLayout
。继承了LinearLayout我是参考代码的。在做天气预报的小程序参考代码的。
但是这样建了后程序运行部了,会报错。请问还要添加什么?或要配置之类的?求解释,谢谢