登录
首页 » Android » Android 自定义弹出式菜单栏源码下载

Android 自定义弹出式菜单栏源码下载

于 2022-10-12 发布 文件大小:19.74 kB
0 225
下载积分: 2 下载次数: 1

代码说明:

Android Custom Menu 弹出窗口式自定义菜单栏的实例源码,运行后通过轻触手机的菜单键,来唤出菜单窗口,再次点击菜单键,自定义弹出对话框则隐藏,菜单是布局在对话框窗口中的,在本例中,自定义弹出窗口继承PopupWindow,并封装有封装GridView组件和View 组件,GridView 为每个Item设置监听事件方法,部分代码先睹为快:   public CustomMenu(Activity activity, List menus) {   super(activity);   //View 样式文件R.layout.menu   view = activity.getLayoutInflater().inflate(R.layout.menu, null);   //实例化GridView组件   gvMenu = (GridView)view.findViewById(R.id.gv_menu);   //相关参数设置   this.setContentView(view);   this.setWidth(LayoutParams.FILL_PARENT);   this.setHeight(LayoutParams.WRAP_CONTENT);   //图片获取   Drawable drawable = activity.getResources().getDrawable(R.drawable.selector_focused_shape);   //相关特效设置   this.setBackgroundDrawable(drawable);   this.setAnimationStyle(R.style.PopupAnimation);   this.setFocusable(true);   //设置相关OnKeyListener事件   gvMenu.setOnKeyListener(new OnKeyListener() {   @Override   public boolean onKey(View v, int keyCode, KeyEvent event) {   if ((keyCode == KeyEvent.KEYCODE_MENU)&&(isShowing())) {    dismiss();//关闭P

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • ZqpGame
    android版本下的一个小游戏,代码简洁,供学习的参考(android version of the game under a small, simple code for reference for learning)
    2011-07-28 10:19:06下载
    积分:1
  • H264Android
    android H264编解码源程序,包含本地代码!(android H264 codec source code contains the local code!)
    2013-04-03 21:10:24下载
    积分:1
  • Shared Preferences project
    在这个项目中,我们正在创建一个android应用程序,它包含以下内容。
    2022-02-11 20:01:33下载
    积分:1
  • androidM权限Utils
    android6.0权限Utils,android6.0权限Utils,android6.0权限Utils,android6.0权限Utils,android6.0权限Utils,android6.0权限Utils,android6.0权限Utils,android6.0权限Utils,android6.0权限Utils,android6.0权限Utils,android6.0权限Utils,android6.0权限Utils,android6.0权限Utils,android6.0权限Utils,android6.0权限Utils,android6.0权限Utils,android6.0权限Utils,android6.0权限Utils,android6.0权限Utils,android6.0权限Utils,android6.0权限Utils,android6.0权限Utils,android6.0权限Utils,android6.0权限Uti
    2022-02-10 08:53:30下载
    积分:1
  • AvdCreationDialog
    AVD creator dialog Source Code for Andriod.
    2013-10-24 10:33:40下载
    积分:1
  • Android英语学习软件
    说明:  Android英语学习应用(包含源代码)英语学习的小应用。每天教您一句英语短句,附带了词典翻译的功能。(Android English learning application (including source code) English learning application. Teach you a short English sentence every day, with a dictionary translation function.)
    2020-03-01 18:09:58下载
    积分:1
  • android-quiz-template-master
    android app code for quiz app. android app code for quiz app.
    2018-01-18 01:57:10下载
    积分:1
  • ListView分页异步加载数据
    ListView分页异步加载数据
    2014-01-08下载
    积分:1
  • Project
    gradle 项目的算法总结,包含几种基础算法(The algorithm summary of gradle project, including several basic algorithms)
    2020-06-23 18:00:02下载
    积分:1
  • Android 创建HttpPost对象 获取HTTP连接
    HttpGet httpGetRequest = new HttpGet(urlGet);//创建HttpPost对象   try {    HttpResponse httpResponse = new DefaultHttpClient().execute(httpGetRequest);    if(httpResponse.getStatusLine().getStatusCode()==200){//连接成功    String result = EntityUtils.toString(httpResponse.getEntity());//获得资源    result = result.replaceAll(" | | | ", "");//去掉信息中的回车和换行    EditText etGet = (EditText)findViewById(R.id.etGet);//获得EditText对象    etGet.setText(result);//为EditText设置内容    }   } catch (Exception e) {//捕获并打印异常    EditText etGet = (EditText)findViewById(R.id.etGet);//获得EditText对象    etGet.setText("连接出错:"+e.getMessage());//为EditText设置出错信息   }
    2022-03-21 18:06:57下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载