1.在创建主-从视图的应用程序时,Master-Detail Application无疑是一个良好的想法,
它结和表视图和详细视图,而且还能调整内容的大小。 主要还能在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;
}
分享到:
相关推荐
◆ 介绍了iOS 5编程的基础知识 ◆ 介绍如何响应及处理设备旋转以及不同类型的屏幕方向 ◆ 展示如何使用Tabbed、Master-Detail、Single View和Utility等 各种应用程序模板 ◆ 探讨在Master-Detail Application中使用...
The journey to master iOS development and the new features of iOS 11 is not straightforward, but this book will help you make that transition. Written for Swift 4 and following the latest Swift API ...
第二十五部分:分割视图控制器(UISplitViewController)和Master-Detail Application模板 第二十六部分:应用UIScrollView滚动视图和手势识别器 第二十七部分:Core Data持久化数据存储 第二十八部分: 使用SQLite...
第二十五部分:分割视图控制器(UISplitViewController)和 Master-Detail Application 模板 第二十六部分:应用 UIScrollView 滚劢视图和手势识别器 第二十七部分:Core Data 持久化数据存储 第二十八部分: 使用 SQLite ...
第二十五部分:分割视图控制器(UISplitViewController)和Master-Detail Application模板 第二十六部分:应用UIScrollView滚动视图和手势识别器 第二十七部分:Core Data持久化数据存储 第二十八部分: 使用SQLite...
33. An iOS 10 Split View Master-Detail Example 34. A Guide to Multitasking in iOS 10 35. An iOS 10 Multitasking Example 36. Working with Directories in Swift on iOS 10 37. Working with Files in Swift ...
这个演示项目是由 XCode 6.1 用“Master-Detail Application”模板创建的。 构建的应用程序不适用于 iOS 7,因为模板使用了一种新方法,该方法仅在 SDK 8 之后可用( UISplitViewController::displayModeButtonItem...
An iOS 8 Split View Master-Detail Example Chapter 31. Implementing a Page based iOS 8 Application using UIPageViewController Chapter 32. An Example iOS 8 UIPageViewController Application Chapter 33. ...
Xamarin Mobile Application Development for iOS is not just your normal everyday book on iOS app development. Everything is written for a point and not for effect, and therefore you will learn ...
An iOS 9 Split View Master-Detail Example Chapter 34. A Guide to Multitasking in iOS 9 Chapter 35. An iOS 9 Multitasking Example Chapter 36. Implementing a Page based iOS 9 Application with ...
Bug with using parameters and column aliases in Master-Detail relation is fixed Bug with assertion failure on editing data in SmartFetch mode is fixed Oracle data provider Bug with memory leak on ...
Bug with using parameters and column aliases in Master-Detail relation is fixed Bug with assertion failure on editing data in SmartFetch mode is fixed Oracle data provider Bug with memory leak on ...
Beginning Swift: Master the fundamentals of programming in Swift 4 pdf Master the fundamentals of programming in Swift 4 Key Features Covers theory and practice in equal parts Teaches you how to ...
This book is for application developers (web, mobile, and desktop) who are interested in building new wearable apps, and mobile developers who already have apps on iTunes or Google Play Store and are ...
This course includes all the resources that will help you jump into the app development .This course covers all the important aspects Swift application development and is divided into individual ...
Two-Pane Master-Detail Interfaces Chapter 18. Assets Chapter 19. Audio Playback with SoundPool Chapter 20. Styles and Themes Chapter 21. XML Drawables Chapter 22. More About Intents and Tasks Chapter...
Over 40 recipes to master mobile device penetration testing with open source tools About This Book Learn application exploitation for popular mobile platforms Improve the current security level for ...
Master the art of building, deploying, and optimizing faster web applications with JavaScript About This Book Test and optimize JavaScript code efficiently Build faster and more proficient JavaScript...
Discover how to create cross platform apps for Android, iOS and UWP using Azure services and C# with Xamarin Forms. This book illustrates how to utilize Azure cloud storage for serving up Azure SQL DB...