Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jul 30, 2011, 06:49 PM   #1
ljg93
Banned
 
Join Date: Mar 2011
Translucent Sectioned Table View Header

Hello,

I have been looking for the line of code that would turn the sectioned table view headers to appear translucent, heres a code snippet.

Code:
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
    self.tableView.sectionHeaderHeight = 40;
    NSString *title = nil;
    // Return a title or nil as appropriate for the section.
    
    switch (section) {
        case 0:
            title = @"Row 1";
            break;
        case 1:
            title = @"Row 2";
            break;
        case 2:
            title = @"Row 3";
            break;
        default:
            break;
    }
    
    UIView *v = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 35)];
    
    UILabel *label = [[[UILabel alloc] initWithFrame:CGRectMake(1,3, tableView.bounds.size.width - 1,35)] autorelease];
    label.text = title;
    label.textColor = [UIColor blackColor];
    label.font = [UIFont fontWithName:@"Arial-BoldMT" size:14];
    label.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"section_bar_blue.png"]];;

    [v addSubview:label];
    //[UIColor colorWithPatternImage:[UIImage imageNamed:@"section_bar_green.png"]];;
    return v;
}
ljg93 is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
Conditionally display views on button press johnmerlino Mac Programming 4 Nov 13, 2011 09:11 AM
some help on Editable Detail views kingthong iPhone/iPad Programming 8 Mar 21, 2011 04:56 AM
Sectioned Table View Help!! geiger10d iPhone/iPad Programming 4 Feb 13, 2011 11:51 AM
How to make scroll table view with fixed header? mikezang iPhone/iPad Programming 1 Jul 4, 2010 08:34 AM
Space between sections in table view ppilone iPhone/iPad Programming 0 Jul 22, 2008 10:49 PM


All times are GMT -5. The time now is 12:17 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC