//解决问题的关键就下面的这段代码
UIView *headerView = [[UIView alloc] initWithFrame: CGRectMake(0, 0, 320, 44)];
self.tableView.tableHeaderView = headerView;
[headerView release];
//加了上面的代码之后tabview就向下移了44个像素,那刚好放上navbar
CGRect aScreenRect = [[UIScreen mainScreen] bounds];
//创建navbar
UINavigationBar *nav = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0, aScreenRect.size.width, 44)];
//创建navbaritem
UINavigationItem *NavTitle = [[UINavigationItem alloc] initWithTitle:@"详细介绍"];
[nav pushNavigationItem:NavTitle animated:YES];
[self.view addSubview:nav];
//创建barbutton 创建系统样式的
UIBarButtonItem *item = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemReply target:self action:@selector(navBackBt:)];
//设置barbutton
NavTitle.leftBarButtonItem = item;
[nav setItems:[NSArray arrayWithObject:NavTitle]];
[item release];
[NavTitle release];
[nav release];
这样就OK了
- 大小: 28.7 KB
分享到:
相关推荐
iOS 多个UIViewController之间滑动切换
AICustomViewControllerTransition, 为iOS创建定制UIViewController转换的简单而简洁的方法 AICustomViewControllerTransition为iOS创建定制UIViewController转换的简单而简洁的方法没有限制,也没有实现...
自己写了一个Dome 实现了UIView或者时UIViewController 缩放动画效果
IOS学习之UiViewController带值跳转以及协议的实现,原来这么做的啊 http://blog.csdn.net/xiaoyuan511
UIViewController添加多个UIViewController。可以把UIViewController的View当作容器,让其他UIViewController添加进该View,并可以在多个UIViewController间切换。
IOS弹出自定义UIViewControllerIOS弹出自定义UIViewController
iOS5 UIViewController 新特性 UIViewController的切换
ios5中UIViewController新使用方法源码 http://mobile.51cto.com/iphone-313146.htm
一、引言 作为MVC设计模式中的C,Controller一直扮演着项目...这里旨在讨论UIViewController的生命周期和属性方法,在最基础的东西上,往往会得到意想不到的惊喜。 二、UIViewController的生命周期 要了解UIViewContr
UIViewController+Present,这个分类是用来适配iOS13之后UIViewController模态弹出问题的. 使用这种方式就不用去项目中挨个找模态弹出了.
CustomViewControllerTransitionsDemo 如何为 iOS 构建自定义 UIViewController 过渡的简单演示
主要介绍了详解iOS App开发中UIViewController的loadView方法使用,讲解了访问view属性时loadView方法的调用及使用loadView时的一些注意点,需要的朋友可以参考下
一种创建自定义交互式UIViewController转换的简单方法.zip,创建自定义交互式uiviewcontroller转换的简单方法
一个轻量级的UIViewController类别扩展,用于UINavigationBar外观管理,视图控制器推送/弹出/关闭管理,内存泄漏检测以及其他方便的属性和方法。 好处包括: 优雅地管理UINavigationBar外观 自动viewController内存...
主要介绍了iOS开发中的UIViewController,其中以UIViewController作为着重讲解,需要的朋友可以参考下
Zingle Zingle –警报将显示在UINavigationBar下方:Santa_Claus::collision:注意:Zingle具有依赖关系,可在您的应用程序中拥有UINavigationController,这意味着如果您不使用Zingle,Zingle将无法在您的应用程序中...
UIViewController是IOS程序中的一个重要组成部分,下面这篇文章主要给大家介绍了关于iOS开发教程之UIView和UIViewController的生命周期的相关资料,文中通过示例代码介绍的非常详细,需要的朋友可以参考下
横向菜单 页面滑动 例子 UIViewController *VC1 = [[UIViewController alloc]init]; [VC1.view setBackgroundColor:[UIColor redColor]]; UIViewController *VC2 = [[UIViewController alloc]init]; ...
在UIViewController内的UITableView中添加静态单元格。什么? 如果UITableView不在UITableViewController内,则不允许将UITableView的单元格设置为静态单元格,因此,不允许在UIViewController内使用Static-Cells ...