android 如何像多看阅读那样转换全屏与有两侧栏 全屏多看阅读 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 可以将上下两个菜单栏的布局分别写两个布局文件,然后在onTouch中 用PopupWindow来显示比如: //假如上面的菜单栏 LayoutInflater mInflater = LayoutInflater.from(context); //layout.del_btn就是你上面的菜单布局文件 View view = mInflater.inflate(R.layout.del_btn, null); //菜单布局文件的控件,这里假设有两个按钮 bt1 = (Button) view.findViewById(R.id.id_item_btn); bt2 = (Button) view.findViewById(R.id.id_item_btn1); popupWindow = new PopupWindow(view, LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT); popupWindow.getContentView().measure(0, 0); //PopupWindow高 pop_h = popupWindow.getContentView().getMeasuredHeight(); //PopupWindow宽 pop_w = popupWindow.getContentView().getMeasuredWidth();上面定义好后,你在点击屏幕或点击MENU键时,调用下面的方法: / /这边动画可有可无 popupWindow.setAnimationStyle(R.style.popwindow_delete_ben_anim_style); popupWindow.update(); //显示的位置,这里面的参数由你来定 popupWindow.showAtLocation(); / /菜单项事件 bt1.setOnClickListener(new OnClickListener() {}; bt1.setOnClickListener(new OnClickListener() {}; 有没有人研究过一键删除手机上短信息通话记录? 密码管理器,源码已经上传 关于Spinner android开发 google map 收音机界面按Back键不停止播放 Android NDK中如何编译Box2d c++获得so文件? eclipse有没有工具分析继承关系? 极光推送技术不就是简单的TCP/IP协议监听吗? 在“Running Android Lint”期间发生了内部错误--有没有哪位大神遇到过这种错误? 读取服务器上的文件不成功 如何用代码模拟照相机里点击拍照键这个事件? 安卓类似于朋友圈的评论功能,当点击评论是从底部弹出输入框,求大家指点下。
比如:
//假如上面的菜单栏
LayoutInflater mInflater = LayoutInflater.from(context);
//layout.del_btn就是你上面的菜单布局文件
View view = mInflater.inflate(R.layout.del_btn, null);
//菜单布局文件的控件,这里假设有两个按钮
bt1 = (Button) view.findViewById(R.id.id_item_btn);
bt2 = (Button) view.findViewById(R.id.id_item_btn1);
popupWindow = new PopupWindow(view,
LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.WRAP_CONTENT);
popupWindow.getContentView().measure(0, 0);
//PopupWindow高
pop_h = popupWindow.getContentView().getMeasuredHeight();
//PopupWindow宽
pop_w = popupWindow.getContentView().getMeasuredWidth();上面定义好后,你在点击屏幕或点击MENU键时,调用下面的方法:
/ /这边动画可有可无
popupWindow.setAnimationStyle(R.style.popwindow_delete_ben_anim_style);
popupWindow.update();
//显示的位置,这里面的参数由你来定
popupWindow.showAtLocation();
/ /菜单项事件
bt1.setOnClickListener(new OnClickListener() {};
bt1.setOnClickListener(new OnClickListener() {};