博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

2014年3月25日

摘要: 在ListView的Adapter中去直接获取传入View的LayoutParams是会报空指针异常的,唯一的方法是在xml中嵌套布局一层LinearLayout 然后再在Adapter的getView中去动态改变即可,关键代码: if (view == null) { view = getActivity().getLayoutInflater().inflate( R.layout.subject_list_item, null);... 阅读全文
posted @ 2014-03-25 22:45 Likwo 阅读(16708) 评论(1) 推荐(2) 编辑