Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 05-08-2009, 02:44 AM   #2 (permalink)
CAJeepBoy
New Member
 
Join Date: May 2009
Posts: 2
Default Okay, after hours or research and coding and re-coding I came up with the following:

Code:
// Need to refactor so that the label is Public Sharing and Priviate Sharing and the actions work for each switch
- (UIView *) tableView: (UITableView *) tableView
viewForFooterInSection: (NSInteger) section
{
  if (section == 0 || section == 1) {
    CGRect screenRect = [[UIScreen mainScreen] applicationFrame];
    UIView* footerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, screenRect.size.width, 44.0)];
    footerView.autoresizesSubviews = YES;
    footerView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
    footerView.userInteractionEnabled = YES;

    footerView.hidden = NO;
    footerView.multipleTouchEnabled = NO;
    footerView.opaque = NO;
    footerView.contentMode = UIViewContentModeScaleToFill;

    // Add the label
    UILabel*	footerLabel = [[UILabel alloc] initWithFrame:CGRectMake(150.0, -5.0, 120.0, 45.0)];
    footerLabel.backgroundColor = [UIColor clearColor];
    footerLabel.opaque = NO;
    footerLabel.text = @"Sharing";
    footerLabel.textColor = [UIColor tableHeaderAndFooterColor];
    footerLabel.highlightedTextColor = [UIColor tableHeaderAndFooterColor];
    footerLabel.font = [UIFont boldSystemFontOfSize:17];
    footerLabel.shadowColor = [UIColor whiteColor];
    footerLabel.shadowOffset = CGSizeMake(0.0, 1.0);
    [footerView addSubview: footerLabel];

    [footerLabel release];	

    // Add the switch
    UISwitch* footerSwitch = [[UISwitch alloc] initWithFrame:CGRectMake(215.0, 5, 80.0, 45.0)];
    [footerView addSubview: footerSwitch];
    
    // Return the footerView
    return footerView;
  }
  else return nil;
}
// Need to call to pad the footer height otherwise the footer collapses
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
  switch (section) {
    case 0:
      return 40.0;
    case 1:
      return 40.0;
    default:
      return 0.0;
  }
}
CAJeepBoy is offline   Reply With Quote
 

» Advertisements
» Online Users: 682
20 members and 662 guests
apatsufas, armmzz, brianmethod, chits12345, ckgni, claudia99, Dani77, devangvyas, Domele, ghost, JamesCahall, k2c, my02820, Objective Zero, oceanlablight, Oral B, rky, robin4kneb, skrew88, SoulRed12
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,784
Threads: 89,204
Posts: 380,594
Top Poster: BrianSlick (7,129)
Welcome to our newest member, claudia99
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 12:01 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.