环境:xocde5.0.2+ios7.0.1

1、导航栏 ----点击科目--------下拉列表

代码:NGRightTableViewViewController.h

#import <UIKit/UIKit.h>

@protocol PulldownMenuDelegate

-(void)menuItemSelected:(NSIndexPath *)indexPath;

-(void)pullDownAnimated:(BOOL)open;

@end



@interface NGRightTableViewViewController : UITableViewController<UITableViewDataSource,UITableViewDelegate>{

 id<PulldownMenuDelegate> pulldelegate;



}



@property (nonatomic, retain) id<PulldownMenuDelegate> pulldelegate;

@property (nonatomic,strong) NSMutableArray *tableViewArray;

@property (nonatomic,strong) NSString *cellString;



-(NSString *) cellString;

@end



NGViewController.h的代码:

#import <UIKit/UIKit.h>

#import "NGRightTableViewViewController.h"

@interface NGViewController : UIViewController<PulldownMenuDelegate>

//- (IBAction)jumpBut:(id)sender;



@property (nonatomic, retain) NGRightTableViewViewController *rtvv;

@end

.m部分代码:

- (void)viewDidLoad

{

    [super viewDidLoad];

    // Do any additional setup after loading the view, typically from a nib.

//    UINavigationController *nav=[[UINavigationController alloc]initWithRootViewController:viewController];

    

    mArray=[[NSMutableArray alloc] initWithObjects:@"uuuuuu",@"qqqu",@"qqqq",@"rrrr",@"yyyyy", nil];

    

    UIButton *secondBut=[[UIButton alloc] initWithFrame:CGRectMake(120, 340, 40, 40)];

    [secondBut setTintColor:[UIColor blueColor]];

    [secondBut setTitle:@"第二" forState:UIControlStateNormal];

    [secondBut setTitleColor:[UIColor redColor] forState:UIControlStateNormal];

    secondBut.titleLabel.font = [UIFont fontWithName:@"System-Bold" size:25.0f];

    [secondBut addTarget:self action:@selector(jumpBut:) forControlEvents:UIControlEventTouchUpInside];

    [self.view addSubview:secondBut];

    

    

    UIBarButtonItem *leftBarBtn = [[UIBarButtonItem alloc] initWithTitle:@"触摸" style:UIBarButtonItemStyleBordered target:self action:@selector(leftBarBtnClicked:)];

    self.navigationItem.leftBarButtonItem = leftBarBtn;

    

    UIBarButtonItem *rightBarBtn = [[UIBarButtonItem alloc] initWithTitle:@"科目" style:UIBarButtonItemStyleBordered target:self action:@selector(rightBarBtnClicked:)];

    self.navigationItem.rightBarButtonItem = rightBarBtn;

    if (rtvv==nil) {

        rtvv=[[NGRightTableViewViewController alloc] init];



    }

    rtvv.tableViewArray=mArray;

//    rtvv.view.frame=CGRectMake(0, 0, 320, 300);

    rtvv.view.frame=CGRectMake(150, 64, 165, 120);

    [self addChildViewController:rtvv];

    [self.view addSubview:rtvv.view];

    rtvv.pulldelegate=self;

    [rtvv.view setHidden:YES];

//    [self.view presentedViewController:rtvv.view];

    

//    [self.. reloadData];

   

}

资源下载

另外有:textField相应keywoard的高度自己主动适应: http://download.csdn.net/detail/shuang60/7927929

ios 导航栏 点击barbutton的按钮 下拉列表的更多相关文章

  1. iOS导航栏背景,标题和返回按钮文字颜色

    在iOS7下,默认导航栏背景,颜色是这样的,接下来我们就进行自定义,如果你仅仅是更改一下背景和颜色,代码会很简单,不需要很复杂的自定义View来替代leftBarItem 更改导航栏的背景和文字Col ...

  2. IOS导航栏的使用方法

    本文是使用纯代码实现一个导航栏的效果.单击按钮并且产生事件.基本思路是: 1.创建一个导航栏(UINavigationBar对象) 2.创建一个导航栏集合(UINavigationItem对象) 3. ...

  3. 转:ios导航栏设置

    原帖:http://www.cocoachina.com/industry/20131104/7287.html 本文提供的代码需要用Xcode 5来执行.如果你还在使用老版本的Xcode,那么在运行 ...

  4. 通过HTML+CSS+Javascript实现向下滚动滚动条出现导航栏并出现回到顶部按钮点击按钮回到顶部(一)

    回到顶部实例一 效果:默认隐藏导航栏,当滚动条滚到超过300px后导航栏和按钮出现,点击回到顶部按钮回到顶部,并隐藏导航栏和按钮(导航栏和按钮都是固定定位) <!doctype html> ...

  5. iOS导航栏NavigationBar的颜色,按钮和标题以及字体颜色

    首先,层级关系: leftBarButtonItem.rightBarButtonItem.title都是加在UINavigationItem上的,UINavigationItem再加在Navigat ...

  6. 自定义iOS7导航栏背景,标题和返回按钮文字颜色

    在iOS7下,默认导航栏背景,颜色是这样的,接下来我们就进行自定义,如果你仅仅是更改一下背景和颜色,代码会很简单,不需要很复杂的自定义View来替代leftBarItem 更改导航栏的背景和文字Col ...

  7. IOS 导航栏属性设置

    IOS 7 以上系统导航栏: [[UINavigationBar appearance] setTintColor:[UIColor whiteColor]]; // 返回按钮颜色 [UINaviga ...

  8. 【转】自定义iOS7导航栏背景,标题和返回按钮文字颜色 -- 不错不错!!

    原文网址:http://blog.csdn.net/mad1989/article/details/41516743 在iOS7下,默认导航栏背景,颜色是这样的,接下来我们就进行自定义,如果你仅仅是更 ...

  9. 【转】 自定义iOS7导航栏背景,标题和返回按钮文字颜色

    原文:http://blog.csdn.net/mad1989/article/details/41516743 UIBarButtonItem,navigationItem,backBarButto ...

随机推荐

  1. kafka+storm 单机运行

    环境: 1.kafka+zookeeper 2.window平台 3.eclipse 设置: 1.kafka和zookeeper安装,另一篇有介绍(https://www.cnblogs.com/51 ...

  2. BZOJ 1485 卡特兰数 数学

    思路: 通过打表观察 这是个卡特兰数 但是它mod的数不是质数 怎么办呢 把所有数分解质因数好了 线性筛出mindiv  顺着mindiv分解质因数 复杂度$O(nlogn)$ //By Sirius ...

  3. [XJOI]noip40 T2统计方案

    统计方案 小B写了一个程序,随机生成了n个正整数,分别是a[1]..a[n],他取出了其中一些数,并把它们乘起来之后模p,得到了余数c.但是没过多久,小B就忘记他选了哪些数,他想把所有可能的取数方案都 ...

  4. .NET WebForm 简介(9.19)

    WebForm是微软开发的一款产品,它将用户的请求和响应都封装为控件.让开发者认为自己是在操作一个windows界面.极大地提高了开发效率. WinForm是C/S(客户端) 主要是本机执行 WebF ...

  5. wpf 错误 执行了 QueryInterface 调用,请求提供 COM 可见的托管类“BoilerMonitoringV1._0.MapControl”的默认 IDispatch 接口。

    在做wpf嵌入地图时,在自定义的WebBrowser 里面使用JavaScript调用外部方法的时报的错误 在原来的WinForm里 我们只要在窗体类设置的头部设置个 [System.Runtime. ...

  6. DB2解决死锁

    方法一.查看db2diag.log文件 找到DeadLock or Lock timeout搜索 死锁或锁超时信息db2 force application(句柄ID)直接结束进程即可. 方法二.DB ...

  7. re模块findall函数用法

    title: Python subtitle: 1.re模块findall函数用法 date: 2018-12-13 10:17:28 --- Python re 模块 findall 函数用法简述 ...

  8. U盘启动盘安装Mac OS

    1.下载macOS High Sierra正式版 http://www.pc6.com/mac/gj_715_1.htm http://www.pc6.com/mac/518996.html 下载ma ...

  9. Java Spring 两大特色

    0 引言 本文主要描述的是Spring常用的两大特色功能:AOP和IoC容器 1 IoC Spring的IoC:就是常说的“控制反转”,也又叫依赖注入的(DI). 优点:IoC最大的好处就是把对象生成 ...

  10. nginx的headers_more模块的使用

    nginx的headers_more模块用于 添加.修改或清除 请求/响应头,该模块不是nginx自带的,默认不包含该模块,需要另外安装.幸运的是openresty默认包含了该模块,可以直接使用. 该 ...