IOS基础知识记录四(Master-Detail Application)
来源:互联网 发布:mac打开文件夹很慢 编辑:程序博客网 时间:2024/04/30 16:14
1.在创建主-从视图的应用程序时,Master-Detail Application无疑是一个良好的想法,
它结和表视图和详细视图,而且还能调整内容的大小。 主要还能在ipad和iphone上面跑起来
不过在ipad上面用到是弹出层(竖屏)
2.在使用xcode 4.5,ios6时,一些基本重要的方法都自动生成,只需要你填入适当的数据即可
3.在DetailViewController中实现代码
4. 在MasterViewController里面 还增加两个默认的编辑按钮和删除按钮。
它结和表视图和详细视图,而且还能调整内容的大小。 主要还能在ipad和iphone上面跑起来
不过在ipad上面用到是弹出层(竖屏)
2.在使用xcode 4.5,ios6时,一些基本重要的方法都自动生成,只需要你填入适当的数据即可
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{//在该方法中部分功能已实现 UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath]; cell.textLabel.text=@"title"// 你需要处理标题 还有付标题 以及image return cell;}//切换时调用方法也生成了,在该方法中可以设置在详细视图中显示的值- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
3.在DetailViewController中实现代码
- (void)configureView{ // Update the user interface for the detail item. if (self.detailItem) { //self.detailDescriptionLabel.text = [self.detailItem description]; //你预在详细页面显示的内容 }}
4. 在MasterViewController里面 还增加两个默认的编辑按钮和删除按钮。
- (void)viewDidLoad{ [super viewDidLoad];// Do any additional setup after loading the view, typically from a nib. self.navigationItem.leftBarButtonItem = self.editButtonItem; UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(insertNewObject:)]; self.navigationItem.rightBarButtonItem = addButton;}
0 0
- IOS基础知识记录四(Master-Detail Application)
- IOS Master-Detail Template Application Demo 解析
- Web Application UI(四):Web-based Master-Detail Grid Form Design
- Master-Detail Application的纯代码实现
- iOS左是master,右边是detail
- 创建基于主-从视图的应用程序(Master-Detail Application)
- Master-Detail GridView
- Master-Detail GridView
- ASPxGridView之Master-Detail
- Master-Detail 用户界面
- ADO.NET Binding: Master Detail
- OAF中的MASTER-DETAIL关系
- OAF中的MASTER-DETAIL关系
- IOS基础知识记录一
- IOS基础知识记录二
- 【iOS开发-107】UISplitViewController:如何取得master和detail控制器,核心在于如何运用代理
- DevExpress控件XtraGrid的Master-Detail用法
- Master-Detail 查询 表体字符串合并
- IOS基础知识记录三(modal模态切换)
- 90. Subsets II
- 【数据结构】算法7.12 AOV-网 拓扑排序
- 谷歌(google)世界各国网址大全世界各国google网址
- MongoDB的安装与配置
- IOS基础知识记录四(Master-Detail Application)
- HTML/CSS: 媒体查询
- IOS基础知识记录五(简单手电筒)
- @RequestParam 同名参数的处理
- IOS基础知识记录六(读写文件)
- STM32系列选型指南
- IOS基础知识记录七(iphone手机横屏、竖屏)
- 从头开始创建django项目和链接postgreSQL
- 欢迎使用CSDN-markdown编辑器