android-仿QQtab(7)
来源:未知 责任编辑:责任编辑 发表时间:2014-05-20 18:32 点击:次
tab2.setOnClickListener(listener);
tab3.setOnClickListener(listener);
RelativeLayout.LayoutParams rl = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
rl.addRule(RelativeLayout.CENTER_IN_PARENT,RelativeLayout.TRUE);
first = new ImageView(this);
first.setTag("first");
first.setImageResource(R.drawable.topbar_select);
switch (current) {
case 1:
layout1.addView(first,rl);
current = R.id.tab1;
text.setText("最近联系人");
break;
case 2:
layout2.addView(first,rl);
current = R.id.tab2;
text.setText("我的联系人");
break;
case 3:
layout3.addView(first,rl);
current = R.id.tab3;
text.setText("我的QQ群联系人");
break;
default:
break;
}
}
private boolean isAdd = false;// 是否添加过 top_select
private int select_width; // top_select_width
private int select_height; // top_select_height
private int firstLeft; // 第一次添加后的左边距*****
private int startLeft; // 起始左边距
// 添加一个view,移除一个view
private void replace(){
switch (current) {
case R.id.tab1:
changeTop(layout1);
break;
case R.id.tab2:
changeTop(layout2);
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>