简体   繁体   中英

Implementing A Mail app-like User Interface

I am trying to implement a user interface that is similar to the iPhone's Mail app.

  • The main screen displays a table. From the table the user can select a cell, at which point the next screen is launched. At the bottom, there is a bar showing a short text and an icon.
  • The second screen displays the details of the cell. It will also be a table display. The bottom bar shows icons associated to this screen.

What kind of layouts do I use to implement this in Xcode? 1. Do I use a View controller, add a View and embed a TableView and a Toolbar inside that view? 2. Do I use a Table View Controller and add a Table View inside it and use the bottom tool bar that comes with the table view?

主屏幕第二屏

In the Table View Programming Guide for iOS , under 'Recommendations for Creating and Configuring Table Views,' it says 'Use an instance of a subclass of UITableViewController to create and manage a table view.' When I use this, the bottom bar can only be fixed or disappear when going back and forth between two screens via segue. That makes me wonder whether I should just use a View controller which is against the recommendation.

Use a UIViewController

Why?

If you are going to display more than a tableView then it is recommended to use a UIViewController for the storyboard.

UIViewController are much more flexible. I guess your confusion comes from the following documentation line:

Use an instance of a subclass of UITableViewController to create and manage a table view

This does not mean you must to drag and drop a UITableViewController on the storyboard. It means your class need to inherit from UITableViewController or at least implement the deleguate and datasource methods.

You would use UITableViewController only and only if you need to display a tableView .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM