Android自定义PopupWindow实现的Menu(TabMenu)(7)
来源:未知 责任编辑:责任编辑 发表时间:2013-11-17 14:38 点击:次
* 未选中项的背景色
* @param selcolor
* 选中项的背景色
*/
public MenuTitleAdapter(Context context, String[] titles, int fontSize,
int fontcolor, int unselcolor, int selcolor) {
this.mContext = context;
this.fontColor = fontcolor;
this.unselcolor = unselcolor;
this.selcolor = selcolor;
this.title = new TextView[titles.length];
for (int i = 0; i < titles.length; i++) {
title[i] = new TextView(mContext);
title[i].setText(titles[i]);
title[i].setTextSize(fontSize);
title[i].setTextColor(fontColor);
title[i].setGravity(Gravity.CENTER);
title[i].setPadding(10, 10, 10, 10);
}
}
public int getCount() {
return title.length;
}
public Object getItem(int position) {
return title[position];
}
public long getItemId(int position) {
return title[position].getId();
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>