KxMenu下拉菜单

+ (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下拉菜单的更多相关文章
- 初学者--bootstrap(六)组件中的下拉菜单----在路上(10)
组件---下拉菜单 用于显示链接列表的可切换.有上下文的菜单.下拉菜单的 JavaScript 插件让它具有了交互性. 将下拉菜单触发器和下拉菜单都包裹在 .dropdown 里,或者另一个声明了 p ...
- Bootstrap3系列:按钮式下拉菜单
1. 基本实例 把按钮放入 .btn-group 中,加入适当的菜单标签,让按钮触发下拉菜单. 1.1 示例代码 <div class="btn-group"> < ...
- Bootstrap3系列:下拉菜单
1.引用Bootstrap 示例引用的Bootstrap版本:v3.3.7 <script src="~/Scripts/jquery-2.2.4.min.js">&l ...
- 如何在webapp中做出原生的ios下拉菜单效果
github:https://github.com/zhoushengmufc/iosselect webapp模仿ios下拉菜单 html下拉菜单select在安卓和IOS下表现不一样,iossel ...
- Html5+Css3制作下拉菜单的三种方式
一.渐变式改变ol的高度 1.外部为ul标签,在每个li里嵌套一个ol列表2.设置外部li左浮动,内部ol标签绝对定位,外部li标签相对定位3.设置ol的高为0,溢出隐藏4.外部li标签:hover ...
- IOS第二天-新浪微博 - 添加搜索框,弹出下拉菜单 ,代理的使用 ,HWTabBar.h(自定义TabBar)
********HWDiscoverViewController.m(发现) - (void)viewDidLoad { [super viewDidLoad]; // 创建搜索框对象 HWSearc ...
- JS实现带复选框的下拉菜单
这段时间在做后台的时候需要一个可以复选的下拉菜单,用到的是easyUI中的combo的Demo,先看看官方easyUI:http://www.jeasyui.com/documentation/ind ...
- 可控制导航下拉方向的jQuery下拉菜单代码
效果:http://hovertree.com/texiao/nav/1/ 代码如下: <!DOCTYPE html> <html> <head> <meta ...
- jquery实现多级下拉菜单
支持多种浏览器,体验效果:http://keleyi.com/keleyi/phtml/jqmenu/4.htm 多级菜单,理论上支持无限多的层级,文件结构非常简单的,以下是完整代码: <!DO ...
随机推荐
- HDR 拍照模式的原理,实现及应用
转自:http://blog.csdn.net/fulinwsuafcie/article/details/9792189 HDR 拍照: (High Dynamic Range Ima ...
- ntp时间同步服务器配置
ntp同步的两种方式:1.使用ntpdate命令直接同步 2.使用NTPD服务平滑同步直接同步方式的缺陷:会导致已经做的定时任务再做一遍.平滑同步每次同步时间的偏移量不会太陡,根据偏移量,均方差等值每 ...
- SgmlReader使用方法
HtmlAgilityPack是一个开源的html解析器,底层是通过将html格式转成标准的xml格式文件来实现的(使用dot net里的XPathDocument等xml相关类),可以从这里下载:h ...
- JavaScript开发规范要求
http://www.cnblogs.com/webflash/archive/2010/06/11/1756255.html 作为一名开发人员(WEB前端JavaScript开发),不规范的开发不仅 ...
- 基于IHttpAsyncHandler的实时大文件传送器
在日常工作中,有时候需要到远程服务器上部署新版本的系统,由于远程服务器出于外网,所以每次都要开QQ连接,非常麻烦.索性就研究了下IHttpasyncHandler,并结合Juqery Progress ...
- window8配置IIS,搭建应用程序网站。
这个里面的一定要勾选,不然会有莫名其妙的错误. 在应用程序池中,如果你是64位电脑,需勾选启用32位应用程序为 true
- [CareerCup] 2.6 Linked List Cycle 单链表中的环
2.6 Given a circular linked list, implement an algorithm which returns the node at the beginning of ...
- LeetCode 笔记24 Palindrome Partitioning II (智商碾压)
Given a string s, partition s such that every substring of the partition is a palindrome. Return the ...
- Bootstrap系列 -- 30. 按钮工具栏
在富文本编辑器中,将按钮组分组排列在一起,比如说复制.剪切和粘贴一组:左对齐.中间对齐.右对齐和两端对齐一组.Bootstrap框架按钮工具栏也提供了这样的制作方法,你只需要将按钮组“btn-grou ...
- The entity type <type> is not part of the model for the current context
这是在网站里遇到的一个错误,自动生成的不能手动添加, reference: http://stackoverflow.com/questions/19695545/the-entity-type-xx ...