XCode: Setting up multiple UITableView columns

后端 未结 3 1178
天命终不由人
天命终不由人 2021-01-24 14:27

I haven\'t found a good answer to this, and I must be dense, but...

I\'m trying to get a table view set up with an image and a label in each row. The image would be an

相关标签:
3条回答
  • 2021-01-24 14:52

    If you just want an image and a label set your tableview cell's style to UITableViewCellStyleDefault add your image to the cell's image view.

    See: http://developer.apple.com/library/ios/#documentation/userexperience/conceptual/TableView_iPhone/TableViewStyles/TableViewCharacteristics.html#//apple_ref/doc/uid/TP40007451-CH3-SW14

    and

    http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UITableViewCell_Class/Reference/Reference.html#//apple_ref/c/econst/UITableViewCellStyleDefault

    0 讨论(0)
  • 2021-01-24 14:54

    Your best course of action is to create your own custom UITableViewCell and specifically design it to include an image and a text label. Anything beyond that means you're going to have to start subclassing UITableView which isn't for the faint of heart. Another option is to look into a 3rd party library such as AQGridView.

    0 讨论(0)
  • 2021-01-24 15:14

    There's no such thing as a column in UITableViews. There's one of 2 routes that come to mind right off the bat.

    1) Use 2 UITableViews that are side-by-side and sync'ed with one another whenever one moves (this may look a little weird)

    2) Stuff the label and the image into the same cell of the UITableView.

    What's your choice?

    One more thing - are you programming for iPhone, iPad?

    0 讨论(0)
提交回复
热议问题