下拉刷新Listview再加一个headerView 布局大乱 怎么办
推荐于2016-11-21 · 知道合伙人互联网行家
关注
展开全部
Rt,本人用的下拉刷新,然后想再给listview加一个header,之后header的布局怎么也不对,是不是listview高度的问题。求大神详细解答下。
public
class GridviewDetailActivity extends BaseActivity implements
OnItemClickListener{
private MyListView lv_com_tab=null;
private MySherlockAdapter Madapter;
private List<ListInfo>
tasks = new ArrayList<ListInfo>();
private XmlParser
xmlParser;
private Context context;
private String path="";
@Override
protected void onCreate(Bundle savedInstanceState)
{
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.competitive_main);
context=GridviewDetailActivity.this;
lv_com_tab=(MyListView)
findViewById(R.id.list);
GridDetailHeaderView headerView=new GridDetailHeaderView(context);
lv_com_tab.addHeaderView(headerView);
lv_com_tab.setOnItemClickListener(this);
lv_com_tab.setonRefreshListener(new OnRefreshListener() {
@Override
public void onRefresh() {
// TODO Auto-generated method stub
asynRefreshTasks();
}
});
public
class GridviewDetailActivity extends BaseActivity implements
OnItemClickListener{
private MyListView lv_com_tab=null;
private MySherlockAdapter Madapter;
private List<ListInfo>
tasks = new ArrayList<ListInfo>();
private XmlParser
xmlParser;
private Context context;
private String path="";
@Override
protected void onCreate(Bundle savedInstanceState)
{
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.competitive_main);
context=GridviewDetailActivity.this;
lv_com_tab=(MyListView)
findViewById(R.id.list);
GridDetailHeaderView headerView=new GridDetailHeaderView(context);
lv_com_tab.addHeaderView(headerView);
lv_com_tab.setOnItemClickListener(this);
lv_com_tab.setonRefreshListener(new OnRefreshListener() {
@Override
public void onRefresh() {
// TODO Auto-generated method stub
asynRefreshTasks();
}
});
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询