Android自定义PopupWindow实现的Menu(TabMenu)(5)
来源:未知 责任编辑:责任编辑 发表时间:2013-11-17 14:38 点击:次
* @param color
* 按钮字体颜色
*/
public MenuBodyAdapter(Context context, String[] texts, int[] resID,
int fontSize, int fontColor) {
this.mContext = context;
this.fontColor = fontColor;
this.texts = texts;
this.fontSize = fontSize;
this.resID = resID;
}
public int getCount() {
return texts.length;
}
public Object getItem(int position) {
return makeMenyBody(position);
}
public long getItemId(int position) {
return position;
}
private LinearLayout makeMenyBody(int position) {
LinearLayout result = new LinearLayout(this.mContext);
result.setOrientation(LinearLayout.VERTICAL);
result.setGravity(Gravity.CENTER_HORIZONTAL
| Gravity.CENTER_VERTICAL);
result.setPadding(10, 10, 10, 10);
TextView text = new TextView(this.mContext);
text.setText(texts[position]);
text.setTextSize(fontSize);
text.setTextColor(fontColor);
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>