+ (void)createMenu:(id)sender target:(UIViewController *)t
{
NSArray *menuItems =
@[ [KxMenuItem menuItem:@"发送给朋友" image:[UIImage imageNamed:@"menu_weixin" ] target:t action:@selector(shareToFriend)],
[KxMenuItem menuItem:@"分享到朋友圈" image:[UIImage imageNamed: @"menu_weixin_circle"] target:t action:@selector(shareToCircle)],
[KxMenuItem menuItem:@"随手摇一摇" image:[UIImage imageNamed: @"menu_shake"] target:t action:@selector(shakeAndShake)],
[KxMenuItem menuItem:@"检查更新" image:[UIImage imageNamed: @"menu_checkupdate"] target:t action:@selector(checkUpdate)],
[KxMenuItem menuItem:@"意见反馈" image:[UIImage imageNamed: @"menu_feedback"] target: t action:@selector(initFeedBack)],
[KxMenuItem menuItem:@"关于闪酷" image:[UIImage imageNamed: @"menu_about"] target:t action:@selector(aboutShanku)], ]; if (IS_IOS7) {
menuItems =
@[ [KxMenuItem menuItem:@"发送给朋友" image:[UIImage imageNamed:@"menu_weixin" ] target:t action:@selector(shareToFriend)],
[KxMenuItem menuItem:@"分享到朋友圈" image:[UIImage imageNamed: @"menu_weixin_circle"] target:t action:@selector(shareToCircle)],
[KxMenuItem menuItem:@"随手摇一摇" image:[UIImage imageNamed: @"menu_shake"] target:t action:@selector(shakeAndShake)],
[KxMenuItem menuItem:@"随手扫一扫" image:[UIImage imageNamed: @"menu_qrcode"] target:t action:@selector(scanAndScan)],
[KxMenuItem menuItem:@"检查更新" image:[UIImage imageNamed: @"menu_checkupdate"] target:t action:@selector(checkUpdate)],
[KxMenuItem menuItem:@"意见反馈" image:[UIImage imageNamed: @"menu_feedback"] target: t action:@selector(initFeedBack)],
[KxMenuItem menuItem:@"关于闪酷" image:[UIImage imageNamed: @"menu_about"] target:t action:@selector(aboutShanku)], ];
} UIView *targetView = (UIView *)[sender performSelector:@selector(view)];
CGRect _rect = targetView.frame;
_rect.origin.y = _rect.origin.y + ;
CGRect rect = _rect; [KxMenu showMenuInView: t.navigationController.view fromRect: rect menuItems:menuItems];
}
// 摇一摇
+ (void) shakeToShake: (NSNotification *) notification
{
NSDictionary *info = [notification userInfo];
SKShakeViewController *shakeView = [[SKShakeViewController alloc] init]; [[info objectForKey:@"controller"] pushViewController:shakeView animated:YES];
} + (void) scanAndScan: (NSNotification *) notification
{
[self setupCamera: notification];
} // 调起相机
+ (void)setupCamera: (NSNotification *) notification
{
NSDictionary *info = [notification userInfo];
if (IS_IOS7) {
SKScanViewController *scan = [[SKScanViewController alloc] init]; [[info objectForKey:@"controller"] presentViewController:scan animated:YES completion:^{ }];
} else { } } // 分享到朋友圈
+ (void) shareToFriendCircle
{ SKAppDelegate *AppDelegate = (SKAppDelegate *)[[UIApplication sharedApplication] delegate];
[AppDelegate changeScene:WXSceneTimeline];
[AppDelegate sendLinkContent];
[MobClick event:@"shareToCircle"];
} + (void) shareToFriend
{
SKAppDelegate *AppDelegate = (SKAppDelegate *)[[UIApplication sharedApplication] delegate];
[AppDelegate changeScene:WXSceneSession];
[AppDelegate sendLinkContent];
[MobClick event:@"shareToFriend"];
} + (void)aboutShanku: (NSNotification *) notification
{
NSDictionary *info = [notification userInfo];
SKAboutViewController *about = [[SKAboutViewController alloc] init];
[[info objectForKey:@"controller"] pushViewController:about animated:YES];
} + (void) checkUpdate
{
[MobClick checkUpdateWithDelegate:self selector:@selector(isUpdate:)];
} + (void)isUpdate:(NSDictionary *)appInfo
{ if ([[appInfo objectForKey:@"update"] isEqualToString:@"NO"]) {
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"" message:@"已经是最新版本" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:nil, nil];
[alertView show];
} } + (NSString *) getBundleVersion
{
NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString *)kCFBundleVersionKey];
return version;
}

KxMenu下拉菜单的更多相关文章

  1. 初学者--bootstrap(六)组件中的下拉菜单----在路上(10)

    组件---下拉菜单 用于显示链接列表的可切换.有上下文的菜单.下拉菜单的 JavaScript 插件让它具有了交互性. 将下拉菜单触发器和下拉菜单都包裹在 .dropdown 里,或者另一个声明了 p ...

  2. Bootstrap3系列:按钮式下拉菜单

    1. 基本实例 把按钮放入 .btn-group 中,加入适当的菜单标签,让按钮触发下拉菜单. 1.1 示例代码 <div class="btn-group"> < ...

  3. Bootstrap3系列:下拉菜单

    1.引用Bootstrap 示例引用的Bootstrap版本:v3.3.7 <script src="~/Scripts/jquery-2.2.4.min.js">&l ...

  4. 如何在webapp中做出原生的ios下拉菜单效果

    github:https://github.com/zhoushengmufc/iosselect webapp模仿ios下拉菜单 html下拉菜单select在安卓和IOS下表现不一样,iossel ...

  5. Html5+Css3制作下拉菜单的三种方式

    一.渐变式改变ol的高度 1.外部为ul标签,在每个li里嵌套一个ol列表2.设置外部li左浮动,内部ol标签绝对定位,外部li标签相对定位3.设置ol的高为0,溢出隐藏4.外部li标签:hover ...

  6. IOS第二天-新浪微博 - 添加搜索框,弹出下拉菜单 ,代理的使用 ,HWTabBar.h(自定义TabBar)

    ********HWDiscoverViewController.m(发现) - (void)viewDidLoad { [super viewDidLoad]; // 创建搜索框对象 HWSearc ...

  7. JS实现带复选框的下拉菜单

    这段时间在做后台的时候需要一个可以复选的下拉菜单,用到的是easyUI中的combo的Demo,先看看官方easyUI:http://www.jeasyui.com/documentation/ind ...

  8. 可控制导航下拉方向的jQuery下拉菜单代码

    效果:http://hovertree.com/texiao/nav/1/ 代码如下: <!DOCTYPE html> <html> <head> <meta ...

  9. jquery实现多级下拉菜单

    支持多种浏览器,体验效果:http://keleyi.com/keleyi/phtml/jqmenu/4.htm 多级菜单,理论上支持无限多的层级,文件结构非常简单的,以下是完整代码: <!DO ...

随机推荐

  1. mysql-advanced-5.6.23-linux-glibc2.5-x86_64安装

    0,二进制安装: mysql-advanced-5.6.23-linux-glibc2.5-x86_64.zip   1,软件包 mysql-advanced-5.6.23-linux-glibc2. ...

  2. C语言 读取文件中特定数据

    //读取文件数据 #define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<stdlib.h> struct jia ...

  3. 通过 SQL Server 视图访问另一个数据库服务器表的方法

    今天项目经理跑过来对我大吼大叫说什么之前安排让我做一大堆接口为什么没做,我直接火了,之前明明没有这个事情…… 不过事情还要解决,好在两个项目都是用的sqlserver,可以通过跨数据库视图来快速解决问 ...

  4. 目标检测——HOG特征

    1.HOG特征: 方向梯度直方图(Histogram of Oriented Gradient, HOG)特征是一种在计算机视觉和图像处理中用来进行物体检测的特征描述子.它通过计算和统计图像局部区域的 ...

  5. 《Java程序设计》第五次实验实验报告

    实验封面 一.实验内容 1.阅读理解源码进入07_httpd所在的目录,使用vi编辑器理解源代码. 2.编译应用程序使用gcc编译器,分别对文件夹下的copy.c和httpd.c进行编译,出现copy ...

  6. Lisp简明教程

    此教程是我花了一点时间和功夫整理出来的,希望能够帮到喜欢Lisp(Common Lisp)的朋友们.本人排版很烂还望多多海涵! <Lisp简明教程>PDF格式下载 <Lisp简明教程 ...

  7. brew-cask 之本地更新 node

    本文同步自我的个人博客:http://www.52cik.com/2015/11/04/brew-cask-local.html 今天 Node v4.2.2 (LTS) 发布,什么是 LTS 呢,百 ...

  8. 解决angular2页面刷新后报404错误

    如果你的angular项目部署到一个tomcat容器里面,localhost:8080是JavaWeb的主页,localhost:8080/driver/login是你angular2项目的登陆地址. ...

  9. bluebird

    nodejs-使用request和bluebird编写的http请求模块   http://blog.csdn.net/o6875461/article/details/44594545

  10. 5、面向对象以及winform的简单运用(方法重载、隐藏、重写与虚方法)

    方法的重载: 规定一个方法可以具有不同的实现,但方法的名称是相同的.如: //同样是Man这个方法 public int Man(int age,int name) { …… } //重载 publi ...