Saturday, October 5, 2013

ipad UITableView's section headerTitle development issues

[Img = http://my.csdn.net/my/album/detail/1287872] [/ img]
ipad development, in the realization of a UITableView multiple section when assigned to each sction headTitle when the teacher assignments on both sides, as shown above.
1.
- (NSString *) tableView: (UITableView *) tableView titleForHeaderInSection: (NSInteger) section {
NSString * str;
if (section == 0)
{
str = @ "website subdomain";
}
if (section == 1)
{
str = @ "List Library";
}
return str;
}
2.

/ / - (UIView *) tableView: (UITableView *) tableView viewForHeaderInSection: (NSInteger) section
/ / {
/ / UIView * viewSection = nil;
/ / If (section == 0)
/ / {
/ / / / ViewSection = [[UIView alloc] initWithFrame: CGRectMake (10, 0, 300, 20)];
/ / ViewSection = [[UIView alloc] init];
/ / ViewSection.backgroundColor = [UIColor clearColor];
/ / / / UILabel * textSection = [[UILabel alloc] initWithFrame: CGRectMake (10,2, 140, 20)];
/ / / / / / TextSection.text = @ "website workspace";
/ / / / TextSection.textColor = [UIColor clearColor];
/ / / / TextSection.backgroundColor = [UIColor clearColor];
/ / / / TextSection.font = [UIFont systemFontOfSize: 20.0f];
/ / / / [ViewSection addSubview: textSection];
/ / / / [TextSection release];
/ /
/ /}
/ / If (section == 1)
/ / {
/ / ViewSection = [[UIView alloc] init];
/ / ViewSection.backgroundColor = [UIColor clearColor];
/ / / / UILabel * textSection = [[UILabel alloc] initWithFrame: CGRectMake (10,2, 140, 20)];
/ / / / / / TextSection.text = @ "List Library";
/ / / / TextSection.textColor = [UIColor redColor];
/ / / / TextSection.backgroundColor = [UIColor clearColor];
/ / / / TextSection.font = [UIFont systemFontOfSize: 20.0f];
/ / / / [ViewSection addSubview: textSection];
/ / / / [TextSection release];
/ /
/ /}
/ / Return [viewSection autorelease];
/ /}

Reply:
Figure Where?
Reply:
quote 1 floor reply:
figure in what?
how Cato, I put on the blog's album chart, and then The address on the link in the wrong?
Reply:
See Figure ah! !

No comments:

Post a Comment