首页 新闻 赞助 找找看

android listView 添加头文件,为什么下面两种方式中注释的一段不行?

0
[待解决问题]
    private void initView(Context context)
    {
        LayoutInflater inflater=LayoutInflater.from(context);
        header=inflater.inflate(R.layout.me_listview_header,null);
        ViewGroup.LayoutParams p=new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);

        //this.addView(header,0,p);//这句为什么不可以
        this.addHeaderView(header);//这句能正确运行
    }

请问为什么注释掉的这句不行。

yzy的主页 yzy | 菜鸟二级 | 园豆:317
提问于:2015-09-23 22:59
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册