Question

I have a 'detail' page where I am displaying info for a club. The page is a UIViewController and consists of buttons and labels to acheive this look (like small grouped tables). When I load this page on a device, it lags a bit, more than any other view in my app.

I assume its because I have quite a few objects on the view controller. Does anyone have any suggestions on how to reduce this lag? Or how to achieve the look the 3 smaller tables like this(grouped) in a different way?

Thanks.

SCREENSHOT: enter image description here

Was it helpful?

Solution

You could try making custom tablecells and use UITableView instead?

OTHER TIPS

You could just make the view a UITableView using UITableViewStyleGrouped style, and then programmatically create the cells for each row. Overriding

- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section

gets you your titles like "Meeting Information" and "Contact", and overriding

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath

gets you correct sizing on each table cell. If the text in "General Information" is not going to be a constant size, you can use the

-sizeWithFont::(UIFont *)font

method of NSString in your heightForRowAtIndexPath implementation.

The issue is not likely your interface design. UI drawing is pretty snappy usually. The things that slow it down are accessing data. If you have a large data set you are searching you might look at ways to speed that up.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top