![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
iOS-导航条
导航条
西半球
好记性不如烂笔头
展开
-
iOS---Nav的navigationBar.translucent
self.navigationController.navigationBar.translucent = YES航栏的属性默认 YES是透明效果并且主view不会偏移 NO是导航栏不透明 主view会向下偏移64px从iOS7开始,苹果对navigationBar进行了模糊处理,并把self.navigationController.navigationBar.translucent = YES...转载 2018-05-24 09:55:13 · 466 阅读 · 0 评论 -
iOS---Nav设置透明与不透明
//透明 [self.navigationController.navigationBar setBackgroundImage:[[UIImage alloc] init] forBarMetrics:UIBarMetricsDefault]; //去掉透明后导航栏下边的黑边 [self.navigationController.navigationBar set...原创 2018-05-23 10:10:13 · 3959 阅读 · 0 评论 -
ios---nav调整item间距,添加按钮设置按钮的高
UIBarButtonItem *space = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil]; //调整items间距 space.width = 20; _attentionBtn =[[U...原创 2018-05-21 19:45:18 · 1068 阅读 · 0 评论 -
ios---导航条设置文字
// 左侧定位 self.navigationItem.leftBarButtonItem =[[UIBarButtonItemalloc]initWithTitle:@"定位"style:UIBarButtonItemStylePlaintarget:selfaction:@selector(ClickScanCode:)]; self.navi原创 2018-05-09 09:57:46 · 515 阅读 · 0 评论 -
iOS -Nav,tab跳转,返回
TabBarViewController *tab =(TabBarViewController *) [UIApplication sharedApplication].windows.firstObject.rootViewController; tab.selectedViewController=tab.viewControllers[1]; sel...原创 2018-05-05 11:07:40 · 725 阅读 · 0 评论 -
ios -导航栏加图片或文字按钮
//为导航栏添加右侧按钮(系统自带删除) // self.navigationItem.rightBarButtonItem=[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemTrash target:self action:@selector(selectMore:)]; ...原创 2018-04-03 09:14:01 · 3950 阅读 · 0 评论 -
iOS---自定义返回按钮 (全局设置)
//自定义返回按钮 (全局设置) UIImage *backButtonImage = [[UIImageimageNamed:@"back"]resizableImageWithCapInsets:UIEdgeInsetsMake(0,30, 0, 0)]; [[UIBarButtonItemappearance] setBackButtonBa转载 2016-04-18 10:31:37 · 4808 阅读 · 0 评论 -
iOS----改变导航条title的字体大小和颜色
//自定义标题 UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0 , 100, 44)]; titleLabel.backgroundColor = [UIColor clearColor]; titleLabel.font = [UIFont systemFont转载 2016-04-18 10:06:21 · 763 阅读 · 0 评论 -
iOS---设置导航条文字
法一:(自定义视图的方法,一般人也会采用这样的方式)就是在导航向上添加一个titleView,可以使用一个label,再设置label的背景颜色透明,字体什么的设置就很简单了。//自定义标题视图UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 200, 44)];titleLabel.ba转载 2015-12-31 11:16:27 · 1807 阅读 · 0 评论 -
iOS---如何把导航默认的返回按钮设置成“返回”
- (void)addBackItemWithAction:(SEL)action { if (IOS7_OR_LATER) { UIBarButtonItem *returnButtonItem = [[UIBarButtonItem alloc] init]; returnButtonItem.title = @"返回"; self.navi转载 2015-12-25 14:05:03 · 316 阅读 · 0 评论 -
iOS---导航条的一些设置
IOS7修改Navigation Bar上的返回按钮文本颜色,箭头颜色以及导航栏按钮的颜色[[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];解决方法 1:自从IOS7后UINavigationBar的一些属性的行为发生了变化.你可以在下图看到:转载 2015-12-24 20:45:00 · 375 阅读 · 0 评论 -
iOS---导航条右边加多个item
//为导航栏添加右侧按钮(分享) UIBarButtonItem *share=[UIBarButtonItemitemWithTarget:selfaction:@selector(Share:)image:@"图片名"]; //为导航栏添加右侧按钮(查看名片) UIBarButtonItem *seeId=[原创 2015-11-30 20:02:06 · 2547 阅读 · 0 评论 -
iOS ---界面跳转
//界面跳转 [selfperformSelector:@selector(showNext)withObject:nilafterDelay:1.0f];-(void)showNext{ 下一个界面的类名 *next=原创 2015-11-01 18:26:18 · 354 阅读 · 0 评论 -
iOS--- 如何获得UIView的父控制器
这个方法用于在自定义的子视图中,实现页面的跳转功能,这里以TableViewController为例子,在自定义的cell中实现导航控制器的压栈。[objc] view plaincopy- (UITableViewController *)viewController { for (UIView *next = [sel转载 2015-11-01 17:19:24 · 5247 阅读 · 0 评论 -
iOS ---视图切换
转载自:http://www.cnblogs.com/chen111/archive/2012/08/28/2660925.html1.NavigationController切换UIViewController的两种方式方法一右侧进入1 SecondViewController* svc=[[SecondViewController alloc]init];转载 2015-10-30 14:42:49 · 340 阅读 · 0 评论 -
iOS --popToViewController -- 跳转界面
问题: nav 从a-b-c-d在d 的界面想直接回到a如下 [self.navigationController popToViewController:[self.navigationController.viewControllers objectAtIndex:0]popToViewController用法原创 2015-10-14 14:32:27 · 2706 阅读 · 0 评论 -
关于导航条
// 导航条 self.navigationItem.title = @"设置"; self.navigationController.navigationBar.tintColor = [UIColor greenColor ]; self.navigationController.navigationBar.barTintColor = [U原创 2015-10-08 11:53:22 · 303 阅读 · 0 评论 -
关于push的使用
一 视图跳转《StoryBoard下的视图跳转》我们知道:segue共有三种类型:push,modal,和custom。如下图://01简单说下这三个的作用:使用导航栏压进新的控制器(push),模态的加载视图控制器(modal),自定义(custom)。好了,废话少说,现在开始我们的旅行。1,首先建立一个Single View 模板的项目,转载 2015-09-25 09:30:28 · 686 阅读 · 0 评论