달력

10

« 2024/10 »

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

Don’t use UITableViewController. Really.
http://www.skylarcantu.com/blog/2009/09/24/dont-use-uitableviewcontroller-really/

Let’s now cover a few reasons why you won’t want to use a UITableViewController.

  • You can not set the background to a custom image. You can only set the UITableView’s background color property. This stifles the UI possibilities within your application. While using the UIViewController, you get full access to its view property; meaning, you get full access to make the background whatever you want the background to be. If you feel so inclined, go ahead and stick a UIImageView in between your view controller’s view and the UITableView. If you set the UITableView’s background color to clearColor, you’ll see the image shining through!
  • You must have the table sized to be full screen (minus status bar height, navbar height, and tab bar height, if applicable). Why would you want to resize a table? Consider UITableView’s header view. Table headers are nice, really; the problem is that they scroll with your UITableView. Using a UIViewController allows you to use a smaller table and your own non scrolling header above it. It really does make your application look better.
  • Have you ever needed to attach a subview in a UITableViewController? It’s not very pretty. Mostly because a UITableView is a subclass of a UIScrollView. I’m sure you can think of a few reasons not to add subviews to a scrollview. However, adding a subview onto your UIViewController is super easy and recommended. It will not only make the new view a subview of your view controller’s main view, but it ensures that the subview does not scroll along with the table. This is ideal when you want to display a pop up message to your user, briefly display a view over your table that dims the table and makes it inaccessible to touches, or if you simply want to present some options. Take a look at this screenshot from FlowChat, the iPhone irc client by my friends over at brancipater. [/commercial]
:
Posted by netkorea