【发布时间】:2011-03-25 21:52:45
【问题描述】:
我很困惑在表格的标题部分制作图像, 我已经将图像放在表格的单元格中,但我不明白如何将图像放在表格的部分部分。 这是我的那个方法的代码..
-
(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
如果(部分 == 0){
// return @"Alpahbets";带字符串
UILabel *alphabet = [[UILabel alloc] initWithFrame:CGRectMake(50, 100, 200, 100)];
alphabet.text = @"Alphabet";
return alphabet.text;
} if (section == 1) {
// return @"罗马";带字符串 UILabel *roman = [[UILabel alloc]initWithFrame:CGRectMake(50, 100, 200, 100)]; roman.text = @"罗马"; 返回 roman.text;
} else {
// return @"Digits"; With String
UILabel *digit = [[UILabel alloc]initWithFrame:CGRectMake(50, 100, 200, 100)];
digit.text = @"Digit";
return digit.text;
}
}
【问题讨论】:
标签: iphone