UITabBarController

5 views
Skip to first unread message

Sathia Moorthy

unread,
May 25, 2012, 5:54:33 AM5/25/12
to iPhone SDK Development
Hi,

I have UITabBarController in my app. The app has 10 tab bars
items. And the app shows four tab bar items as usual. And getting
more button to view other 6 tab bar items in UITableview. I have to
change the background of that tableView. Is it possible to change
that?.


Thanks!

Sam Jentsch

unread,
May 25, 2012, 7:45:29 AM5/25/12
to iphonesdkd...@googlegroups.com
Do you want to change the cells in the tableView? You can use one of the table delegate methods to return a custom cell. Make sure your object controlling the table conforms to the UITableViewDelegate and UITableViewDataSource protocols.

Here's the method that will return a tableViewCell initialized from a nib file. You can create the cell from an nib file or just with code in the method.

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *CustomCellIdentifier = @"CustomCellIdentifier";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CustomCellIdentifier];
    if (cell == nil) {
        NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"CustomTableCell" owner:self options:nil];
        if ([nib count] > 0) {
            cell = self.customCell;
        } else {
            NSLog(@"Failed to load custom cell.");
        }
    }
 
    return cell;
}

Let me know if you need any more help!

Sam


--
You received this message because you are subscribed to the Google Groups "iPhone SDK Development" group.
To post to this group, send email to iphonesdkd...@googlegroups.com.
To unsubscribe from this group, send email to iphonesdkdevelop...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/iphonesdkdevelopment?hl=en.


Vivek Shah

unread,
May 25, 2012, 6:09:01 AM5/25/12
to iphonesdkd...@googlegroups.com
Hey Hi , 

Try This to Provide Background .

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
	tableView.backgroundColor = [UIImage imageNamed:@"hawaii.jpg"];
	return 1;
}

--
You received this message because you are subscribed to the Google Groups "iPhone SDK Development" group.
To post to this group, send email to iphonesdkd...@googlegroups.com.
To unsubscribe from this group, send email to iphonesdkdevelop...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/iphonesdkdevelopment?hl=en.




--
--
Thanks & Regards 
Vivek P Shah

Reply all
Reply to author
Forward
0 new messages