解决方案 »
- 新人求教:大家用的什么版本SDK开发的?
- ListView疑难
- android4.0下, 如何将Launcher2 上应用的图标放大
- 请教android使用youtube API问题
- 如何将数据库文件导入到Android 真机中?
- HandlerThread求教,很困难。请牛人进来解答一下
- 有关于EditText的问题,高手快来帮忙解决一下啊
- 为什么使用AsyncTask可以解决UI主线程阻塞的问题?
- eclips 生成的代码中有问题,总是提示 import android.support.v17.错误
- activity如何给里面的fragment发消息
- android平台数据包抓取
- 一个layout中多个控件大小相等问题.
public class TutorialView extends RelativeLayout { private View baseView; public TutorialView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
mContext = context;
} public TutorialView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
mContext = context;
} public TutorialView(Context context) {
this(context, null);
mContext = context;
} public TutorialView(Context context, int step) {
this(context);
this.step = step;
mContext = context;
init();
} private void init() {
baseView = LayoutInflater.from(mContext).inflate(
R.layout.my_relative_view, this);
}
}
这样就可以了。具体的逻辑你可以写到init里,比如webView的内容啊,closebutton的监听啊。或者加一些其他的方法。