不错的一个介绍: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];//修改背景[用颜色] 注意:会连按钮色也改了
分享到:
相关推荐
[self.button addTarget:self action:@selector(buttonTouchUpInside) forControlEvents:UIControlEventTouchUpInside]; [self.button addTarget:self action:@selector(buttonTouchUpOutside) forControlEvents:...
[self.recordButton addTarget:self action:@selector(recordButtonClicked:) forControlEvents:UIControlEventTouchUpInside]; [self.playButton addTarget:self action:@selector(playButtonClicked:) ...
_timer = [NSTimer timerWithTimeInterval:2 target:self selector:@selector(play) userInfo:nil repeats:YES]; [[NSRunLoop currentRunLoop]addTimer:_timer forMode:NSDefaultRunLoopMode]; 改为: /*每...
action:@selector(feedBack:)], UIButton * btn = sender; [KxMenu showMenuInView:self.view fromRect:btn.frame menuItems:menuItems]; } - (void) feedBack:(id)sender { [self performSegueWithIdentifier...
[btn addTarget:self action:@selector(timeDidClick) forControlEvents:UIControlEventTouchUpInside]; Style [btn setBackgroundImage:[UIImage imageNamed:@"xxx.png"]]; [btn setBackgroundColor:...
#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的函数如何传参数
selector:@selector(enterBackground:) name:UIApplicationDidEnterBackgroundNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(enterForeground:) ...
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(itemDidFinishPlaying:) name:AVPlayerItemDidPlayToEndTimeNotification object:playerItem]; - (void)itemDidFinishPlaying:...
if ([self.delegate respondsToSelector:@selector(didSelectRow:andCityZip:)]){ CityItems *item = [_dataArray objectAtIndex:indexPath.row]; [self.delegate didSelectRow:self andCityZip:item.zip]; } ...
[$ swizzleMethod:@selector(setTitle:) with:@selector(nav_setTitle:) in:[Scene class]]; [$ swizzleMethod:@selector(showBarButton:button:) with:@selector(nav_showBarButton:button:) in:[Scene class]]; ...
NSInvocationOperation *operation = [[NSInvocationOperation alloc] initWithTarget:self selector:@selector(doSomething:) object:@"hi"]; ``` 3. **添加操作到队列**: ```objective-c [queue ...
首先,我们要明确一点:在iOS中,默认情况下,状态栏的背景颜色会根据当前显示的ViewController的背景色自动调整。但有时我们可能需要自定义状态栏的颜色以达到特定的视觉效果,这时就可以通过以下方法实现: ```...
UIBarButtonItem *rightButton = [[UIBarButtonItem alloc] initWithTitle:@"右边" style:UIBarButtonItemStyleDone target:self action:@selector(clickRightButton)]; [self.navigationItem setRightBarButtonItem...
[(NSObject*)self performSelector:@selector(request:didUpdateStatus:) withObject:self withObject:status]; 应该是 [(NSObject*)self.delegate performSelector:@selector(request:didUpdateStatus:) with...
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] ...
[_filter addTarget:self action:@selector(filterValueChanged:) forControlEvents:UIControlEventTouchUpInside]; [_filter setProgressColor:[UIColor groupTableViewBackgroundColor]];//设置滑杆的颜色 [_...
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(disableCopying:)]; tapGesture.cancelsTouchesInView = NO; [self.yourTextField ...