+ (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. NET Office 组件Spire

    高效而稳定的企业级.NET Office 组件Spire   在项目开发中,尤其是企业的业务系统中,对文档的操作是非常多的,有时几乎给人一种错觉的是"这个系统似乎就是专门操作文档的" ...

  2. [服务]ftp主动模式和被动模式

    经常忘记这个东西.于是总结下这东西感受下这个协议. FTP连接方式 控制连接:标准端口为21,用于发送FTP命令信息 数据连接:标准端口为20,用于上传.下载数据 数据连接的建立类型: 主动模式:服务 ...

  3. The Skyline Problem

    A city's skyline is the outer contour of the silhouette formed by all the buildings in that city whe ...

  4. Linux 进程与线程三(线程比较--创建线程参数)

    int pthread_equal(pthread_t th1,pthread_t th2); pthread_equal函数比较th1与th2是否为同一线程,由于不可以讲pthread_t数据类型认 ...

  5. U3D5.3.5f Monodevelop 仅支持到.NET 3.5

    2016年12月2号:发现这个标题是错误的,可以在monodevelop中选择.NET的版本,如下:打开solution,右击 Assembly-CSharp,options, build, gene ...

  6. CSS3 chart

    利用CSS3技术生成统计图. 原理:利用元素的百分比算出旋转度数.类似于斗地主时,手拿扑克牌的形状. 程序源码: <!DOCTYPE html> <html> <head ...

  7. [vim]vim 在win下乱码解决

    vim在win下遇到汉字乱码早就知晓,本以为通过如下设置即可解决乱码问题 set encoding=utf-8 set fileencoding=utf-8,chinese 这样设置是可以解决源码文件 ...

  8. 利用link标签的disabed属性大面积的对其他标签元素的CSS样式进行替换操作

    由于平时对元素样式的控制基本上只是3,4个,所以一般用Jquery的时候直接使用$(element).css();这个方法,或者使用$(element).addClass()方法完成样式操作.对于小范 ...

  9. 怎样写 OpenStack Neutron 的 Extension (三)

    通过上几章的介绍,我们现在的 myplugin 文件夹看上去应该是这样的: - neutron/ - plugins/ - myplugin/ - __init__.py - plugin.py - ...

  10. Javascript 里的 in

    写js的时候需要遍历一个对象的属性,把属性名和属性值都提出来,之前没遇到这种需求,查了一下可以用for in的方式. var obj = { "key1":"value1 ...