I am designing an interface that basically looks the same as the Settings application. That is, I have 开发者_开发技巧a grouped TableView with cells that look like UITableViewCellStyleValue1. There are labels with values associated with them. The difference is, I am making custom UITableViewCell nibs so that the "value" can be a textbox, segmented control, etc., just like in the Settings app.
To keep my code general, I am giving each label a tag of 1, and the associated value a tag of 2. I would also like to incorporate generic UITableViewCells without having to use a special case. Are there default tags associated with the textLabel and detailTextLabel views with which I can match my customs cells? Other design suggestions are welcome too.
You may benefit from the hard work already done by people to achieve this:
http://furbo.org/2009/04/30/matt-gallagher-deserves-a-medal/
That blog post links to a Generic Table Views set of classes that really make this kind of interface simple to create. I use it in my own apps and it's perfect.
The only thing you'll need to do is rename some of the method calls to update them from 2.x APIs to 3.0 (replace initWithFrame:reuseIdentifier:
to initWithStyle:reuseIdentifier:
on the table cells).
Nice and simple, and looks great.
精彩评论