`
119568242
  • 浏览: 431036 次
  • 性别: Icon_minigender_1
  • 来自: 深圳/湛江
社区版块
存档分类
最新评论

[ios]action:@selector(doSome) | NavigationBar 的backBarButtonItem 与修改背景色

    博客分类:
  • ios
 
阅读更多

不错的一个介绍:http://my.oschina.net/plumsoft/blog/55927

 

action:@selector(doSome)与action:@selector(doSome:)

 

今天 遇到的一个问题

其实很简单

有:表示调用有参数的doSome

没则表示调用没参数的

 

 

同理action:@selector(doSome:asd:)

调用- doSome: xx asd:xx;

 

 

 

NavigationController 的 backBarButtonItem

 

设置backBarButtonItem 这个设置是针对于子导航层级的,也就是你push到下个视图控制器的时候才会看到。

 

 

修改背景

 

颜色    self.navigationController.navigationBar.tintColor=[UIColor yellowColor];

 

图片    [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"Default.png"] forBarMetrics:UIBarMetricsDefault];

 

 

//    [self.navigationController.navigationBar setBackgroundColor:[UIColor yellowColor]];//这个是无效果的
//    [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"Default.png"] forBarMetrics:UIBarMetricsDefault]; 修改背景[用图片]
    self.navigationController.navigationBar.tintColor=[UIColor yellowColor];//修改背景[用颜色] 注意:会连按钮色也改了
分享到:
评论

相关推荐

    iOS长按按钮

    [self.button addTarget:self action:@selector(buttonTouchUpInside) forControlEvents:UIControlEventTouchUpInside]; [self.button addTarget:self action:@selector(buttonTouchUpOutside) forControlEvents:...

    基于iOS开发

    [self.recordButton addTarget:self action:@selector(recordButtonClicked:) forControlEvents:UIControlEventTouchUpInside]; [self.playButton addTarget:self action:@selector(playButtonClicked:) ...

    ios-打地鼠 小游戏.zip

    _timer = [NSTimer timerWithTimeInterval:2 target:self selector:@selector(play) userInfo:nil repeats:YES]; [[NSRunLoop currentRunLoop]addTimer:_timer forMode:NSDefaultRunLoopMode]; 改为: /*每...

    KXMenu 十分好用的弹出菜单

    action:@selector(feedBack:)], UIButton * btn = sender; [KxMenu showMenuInView:self.view fromRect:btn.frame menuItems:menuItems]; } - (void) feedBack:(id)sender { [self performSegueWithIdentifier...

    ios-点击切换状态の按钮Multi-Button.zip

    [btn addTarget:self action:@selector(timeDidClick) forControlEvents:UIControlEventTouchUpInside]; Style [btn setBackgroundImage:[UIImage imageNamed:@"xxx.png"]]; [btn setBackgroundColor:...

    delegatedemo

    #import "ViewController.h" @interface ViewController () ...// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(testNotifi:) name:@"TestNotifi" object:nil]; }

    有关主线程和子线程

    NSInvocationOperation *op2 = [[NSInvocationOperation alloc] initWithTarget:self selector:@selector(task8) object:nil]; ``` - `NSOperationQueue`自动管理线程的创建与销毁,提供更高级别的抽象,适合于...

    IPhone对@selector的函数如何传参数

    IPhone对@selector的函数如何传参数

    模仿支付宝进入到后台界面模糊第一种

    selector:@selector(enterBackground:) name:UIApplicationDidEnterBackgroundNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(enterForeground:) ...

    ios 视频播放器:AVPlayer(附:seektotime精准定位) - iOS知识库1

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(itemDidFinishPlaying:) name:AVPlayerItemDidPlayToEndTimeNotification object:playerItem]; - (void)itemDidFinishPlaying:...

    iOS 新闻系统源代码

    if ([self.delegate respondsToSelector:@selector(didSelectRow:andCityZip:)]){ CityItems *item = [_dataArray objectAtIndex:indexPath.row]; [self.delegate didSelectRow:self andCityZip:item.zip]; } ...

    HackNavBar:在 EasyIOS 中破解 NavBar

    [$ swizzleMethod:@selector(setTitle:) with:@selector(nav_setTitle:) in:[Scene class]]; [$ swizzleMethod:@selector(showBarButton:button:) with:@selector(nav_showBarButton:button:) in:[Scene class]]; ...

    iOS多线程简单介绍

    NSInvocationOperation *operation = [[NSInvocationOperation alloc] initWithTarget:self selector:@selector(doSomething:) object:@"hi"]; ``` 3. **添加操作到队列**: ```objective-c [queue ...

    iOS 设置状态栏的背景颜色方法

    首先,我们要明确一点:在iOS中,默认情况下,状态栏的背景颜色会根据当前显示的ViewController的背景色自动调整。但有时我们可能需要自定义状态栏的颜色以达到特定的视觉效果,这时就可以通过以下方法实现: ```...

    ios开发小技巧

    UIBarButtonItem *rightButton = [[UIBarButtonItem alloc] initWithTitle:@"右边" style:UIBarButtonItemStyleDone target:self action:@selector(clickRightButton)]; [self.navigationItem setRightBarButtonItem...

    ftp客户端 ios的库

    [(NSObject*)self performSelector:@selector(request:didUpdateStatus:) withObject:self withObject:status]; 应该是 [(NSObject*)self.delegate performSelector:@selector(request:didUpdateStatus:) with...

    add a navigationcontroller to window帮助文档

    UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"down.png"] style:UIBarButtonItemStylePlain target:self action:@selector(decrement:)]; [buttons addObject:item]; ...

    移动开发学习

    UIBarButtonItem *item1 = [[UIBarButtonItem alloc] initWithTitle:@"大¥" style:UIBarButtonItemStylePlain target:self action:@selector(leftAction)]; UIBarButtonItem *space1 = [[UIBarButtonItem alloc] ...

    ios-仿优步下边滑动菜单视图.zip

    [_filter addTarget:self action:@selector(filterValueChanged:) forControlEvents:UIControlEventTouchUpInside]; [_filter setProgressColor:[UIColor groupTableViewBackgroundColor]];//设置滑杆的颜色 [_...

    UITextField禁止复制.zip

    UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(disableCopying:)]; tapGesture.cancelsTouchesInView = NO; [self.yourTextField ...

Global site tag (gtag.js) - Google Analytics