From e993e7ba4e1107a875afeec33292b9d01c52035b Mon Sep 17 00:00:00 2001 From: matt handler Date: Sat, 30 Apr 2011 09:25:32 -0400 Subject: added loading animation, piccast color title, navigation controllers for browse and search, uicolor orange and yellow, custom headers for search view, redid loading screen, fixed backgroundGradient, background white for topic table, etc etc etc gay --- Classes/SearchViewController.m | 47 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 3 deletions(-) (limited to 'Classes/SearchViewController.m') diff --git a/Classes/SearchViewController.m b/Classes/SearchViewController.m index 8272dd9..e4718be 100644 --- a/Classes/SearchViewController.m +++ b/Classes/SearchViewController.m @@ -17,6 +17,14 @@ - (void)viewDidLoad { [super viewDidLoad]; + [self.navigationController.navigationBar drawLogo]; + + UIView *backgroundView = [[UIView alloc] initWithFrame:self.view.frame]; + backgroundView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"backgroundGradient.png"]]; + + self.tableView.backgroundView = backgroundView; + self.tableView.backgroundColor = [UIColor clearColor]; + [self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleSingleLine]; [self.tableView setSeparatorColor:[UIColor colorWithRed:0.9 green:0.9 blue:0.9 alpha:1.0]]; @@ -132,16 +140,49 @@ #pragma mark - #pragma mark uitableviewcontroller protocol +- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section +{ + // create the parent view that will hold header Label + UIView* customView = [[UIView alloc] initWithFrame:CGRectMake(10.0, 0.0, 300.0, 44.0)]; + + // create the button object + UILabel * headerLabel = [[UILabel alloc] initWithFrame:CGRectZero]; + headerLabel.backgroundColor = [UIColor clearColor]; + headerLabel.opaque = NO; + headerLabel.textColor = [UIColor orangeColor]; + headerLabel.highlightedTextColor = [UIColor whiteColor]; + headerLabel.font = [UIFont boldSystemFontOfSize:20]; + headerLabel.frame = CGRectMake(10.0, 0.0, 300.0, 44.0); + + // If you want to align the header text as centered + // headerLabel.frame = CGRectMake(150.0, 0.0, 300.0, 44.0); + + headerLabel.text = @"tamper proof cap"; // i.e. array element + [customView addSubview:headerLabel]; + + return customView; +} + +- (CGFloat) tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section +{ + return 44.0; +} + - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - return 10; + return 3; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - return 5; + return 3; } - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { - return @"tamper proof cap"; + if (section == 0) + return @"Feeds"; + else if (section == 1) + return @"Sets"; + else + return @"Photos"; } //- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath -- cgit v1.2.3