开发者

Giving color to the title in tableView in iphone

I am new to iPhone development. I want to change the colour of the title to brown. In default it is in gray colour. To display the title I am using the following method:

- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
    return @"Title";
}

I want to change the title backgou开发者_如何学Gond colour.

please help me out.

Thanks.


You will have to create a UIView subclass that closely represents what is provided by default. Then change the color of your label. Then you can implement:

- (UIView *)tableView:(UITableView *)tableView 
                viewForHeaderInSection:(NSInteger)section;

Which should return your custom view.


- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger) section

Could be the method you're looking for.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜