I am trying to create a UITableViewCell with multiple labels. I have been trying to do something similar (have "Name" and "Phone Number" left aligned and on two lines, then have "Age" right aligned in the cell and possibly vertically centered. I have tried the different UITableViewCellStyle styles but wanted to customize it so that the cell can contain 3 labels instead of just two. Any help would be greatly appreciated. Thanks in advance!
相关问题
- How can i associate an IBAction event with an imag
- ios5 background management different from ios4?
- CGContext & CGBitmapContextCreateImage errors, how
- loaded the “rootView” nib but didn't get a UIT
- What does “UIBackgroundTaskInvalid” mean?
相关文章
- Why are my UIView layer properties not being set w
- Why is self.navigationItem.backBarButtonItem alway
- Does an In App Purchase's Product ID have to b
- Cant launch iOS app with Instruments on device
- Passing UISegmentedControl values from FlipSideVie
- Extending In-App Purhcase content (Magazine) to mo
- reloadData in MasterView from DetailView
- How to install iphone sdk 4 on Mac OSX 10.5.8
One thing you can do is make a custom UITableViewCell in interface builder and add whatever labels etc you want to it and use that cell when you are populating your rows instead.
in your .h file you would need an IBOutlet UITableViewCell yourCellName
in your .m file
you can configure your custom cell in a method like the following:
then in this method you can populate your table with the custom cell(s)
Sorry for the rough example, hope it at least helps you get started.
If you want to have your own cells in a
UITableView
you need to use a subclass ofUITableViewCell
. There are many examples of this, such as this one from Cocoa With Love.Create a new class which extends UITableViewCell. I give you an example: