Reputation: 783
i want to customize table cell to show data like this (chk image)
Upvotes: 0
Views: 2867
Reputation: 6216
You can subclass UITableViewCell.
In Xcode -> New File -> Objective-C class -> Subclass of UITableViewCell
Then in your tableview at cellForRowAtIndexPath
:
static NSString *CellIdentifier = @"Cell";
MySubclassedTableviewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[MySubclassedTableviewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
// Configure the cell...
return cell;
Upvotes: 1
Reputation: 12787
For those rows which you want set color like above the simply set this color (shown in above pic) fo cell' background color.
or find this color use digital meter and use that rgb. like this
[UIColor colorWithRed:200.0/255 green:200.0/255 blue:200.0/255 alpha:1.0];
replace 200.0 with your rgb values
waht you need, you need to store data in common array for simply showing single detail you need to save that in form of string others in dictionary format. And at time of showing data.
check wheter object is string or dictionary, and show accordingly.
for checking type of object use this
if([[myArray objectAtIndex:index] isKindOfClass:[NSString class]])
Upvotes: 3
Reputation: 3637
You can implement delegate method of viewForHeaderInSection: and implement view for yellow area shown in screenshot, and for for rest, you can implement custom table view cell inherited from UITableViewCell
Upvotes: 1