Android自定义PopupWindow实现的Menu(TabMenu)(2)
<TextView android:id="@+id/TextView01" android:layout_height="wrap_content"
android:layout_width="fill_parent" android:text="扩展Menu"></TextView>
</LinearLayout>
TabMenu的封装类TabMenu.java的源码如下:
Java代码
package com.iaiai.activity;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.TextView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.LinearLayout.LayoutParams;
/**
*
* <p>
* Title: TabMenu.java
* </p>
* <p>
* E-Mail: 176291935@qq.com
* </p>
* <p>
* QQ: 176291935
* </p>
* <p>
* Http: iaiai.iteye.com
* </p>
* <p>
* Create time: 2011-8-17
* </p>
*
* @author 丸子
* @version 0.0.1
*/
public class TabMenu extends PopupWindow {
private GridView gvBody, gvTitle;
private LinearLayout mLayout;
private MenuTitleAdapter titleAdapter;
public TabMenu(Context context, OnItemClickListener titleClick,
OnItemClickListener bodyClick, MenuTitleAdapter titleAdapter,
int colorBgTabMenu, int aniTabMenu) {
super(context);
mLayout = new LinearLayout(context);
mLayout.setOrientation(LinearLayout.VERTICAL);
// 标题选项栏
gvTitle = new GridView(context);
gvTitle.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.WRAP_CONTENT));
gvTitle.setNumColumns(titleAdapter.getCount());
相关新闻>>
- 发表评论
-
- 最新评论 更多>>