Android自定义PopupWindow实现的Menu(TabMenu)(10)
来源:未知 责任编辑:责任编辑 发表时间:2013-11-17 14:38 点击:次
R.drawable.menu_cut, R.drawable.menu_normalmode,
R.drawable.menu_quit }, 13, 0xFFFFFFFF);
tabMenu = new TabMenu(this, new TitleClickEvent(),
new BodyClickEvent(), titleAdapter, 0x55123456,// TabMenu的背景颜色
R.style.PopupAnimation);// 出现与消失的动画
tabMenu.update();
tabMenu.SetTitleSelect(0);
tabMenu.SetBodyAdapter(bodyAdapter[0]);
}
class TitleClickEvent implements OnItemClickListener {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
selTitle = arg2;
tabMenu.SetTitleSelect(arg2);
tabMenu.SetBodyAdapter(bodyAdapter[arg2]);
}
}
class BodyClickEvent implements OnItemClickListener {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
tabMenu.SetBodySelect(arg2, Color.GRAY);
String str = "第" + String.valueOf(selTitle) + "栏\n\r" + "第"
+ String.valueOf(arg2) + "项";
Toast.makeText(MainMenuView.this, str, 500).show();
}
}
@Override
/**
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>