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

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

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

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 05-19-2010, 03:02 PM   #1 (permalink)
Registered Member
 
Join Date: May 2010
Posts: 7
alewis is on a distinguished road
Default Font Color

I am new to iphone SDK Development. I have created a 8 page tableview rss feeder that allows me to see my Newest post on Youtube, 4 different blogs and Twitter. I have created this app from watching videos and reading I still have a big problem that I can not figure out and have not been able to find any answers.I put a background image on my blog tableview( on all of them but just for example) and it is a black background. Well the text is black also so I can not see the text. Is there a way to make it so my text is white so that I can see everything in the table?
alewis is offline   Reply With Quote
Old 05-19-2010, 03:11 PM   #2 (permalink)
Registered Member
 
Join Date: May 2010
Posts: 31
kyledecot is on a distinguished road
Default

Quote:
Originally Posted by alewis View Post
I am new to iphone SDK Development. I have created a 8 page tableview rss feeder that allows me to see my Newest post on Youtube, 4 different blogs and Twitter. I have created this app from watching videos and reading I still have a big problem that I can not figure out and have not been able to find any answers.I put a background image on my blog tableview( on all of them but just for example) and it is a black background. Well the text is black also so I can not see the text. Is there a way to make it so my text is white so that I can see everything in the table?
It would depend on how you are doing your table. Are you just inserting the text into your tableview cell as a subview or are you drawing in the cell in your drawRect: method?
kyledecot is offline   Reply With Quote
Old 05-19-2010, 05:45 PM   #3 (permalink)
Registered Member
 
Join Date: May 2010
Posts: 16
Maksumko is on a distinguished road
Send a message via ICQ to Maksumko
Default

2alewis

What component you use to out text?
Maksumko is offline   Reply With Quote
Old 05-24-2010, 12:00 PM   #4 (permalink)
Registered Member
 
Join Date: May 2010
Posts: 7
alewis is on a distinguished road
Default

Quote:
Originally Posted by kyledecot View Post
It would depend on how you are doing your table. Are you just inserting the text into your tableview cell as a subview or are you drawing in the cell in your drawRect: method?
I am inserting it as a subview
alewis is offline   Reply With Quote
Old 05-24-2010, 12:02 PM   #5 (permalink)
Registered Member
 
Join Date: May 2010
Posts: 7
alewis is on a distinguished road
Default

Quote:
Originally Posted by Maksumko View Post
2alewis

What component you use to out text?
Well what do you mean? I have a lot of components doing a lot of different things! I just really am confused
alewis is offline   Reply With Quote
Old 05-24-2010, 09:58 PM   #6 (permalink)
Registered Member
 
kerofrog's Avatar
 
Join Date: May 2010
Posts: 63
kerofrog is on a distinguished road
Default

Assuming that I have read your question correctly. You wish to change the text color of the text in the cells of your tableview?

You can do this in your cellForRowAtIndexPath method. Code shown below.

Code:
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    static NSString *CellIdentifier = @"Cell";
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        // One of the styles you can use, the other three are UITableViewCellStyleDefault,
        // UITableViewCellStyleValue1 and UITableViewCellStyleValue2
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
    }
    
    // Set up the cell...
    
    // Change the text color of the cell
    cell.textLabel.textColor = [UIColor whiteColor];

    // If you also have a detail text label
    cell.detailTextLabel.textColor = [UIColor whiteColor];
	
    return cell;
}
kerofrog is offline   Reply With Quote
Old 05-28-2010, 08:31 AM   #7 (permalink)
Registered Member
 
Join Date: May 2010
Posts: 7
alewis is on a distinguished road
Default

Quote:
Originally Posted by kerofrog View Post
Assuming that I have read your question correctly. You wish to change the text color of the text in the cells of your tableview?

You can do this in your cellForRowAtIndexPath method. Code shown below.

Code:
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    static NSString *CellIdentifier = @"Cell";
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        // One of the styles you can use, the other three are UITableViewCellStyleDefault,
        // UITableViewCellStyleValue1 and UITableViewCellStyleValue2
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
    }
    
    // Set up the cell...
    
    // Change the text color of the cell
    cell.textLabel.textColor = [UIColor whiteColor];

    // If you also have a detail text label
    cell.detailTextLabel.textColor = [UIColor whiteColor];
	
    return cell;
}
THANK YOU! You are amazing!!! I have one more question? I have created a background for each page with a different variation of my Logo. The problem is when I go from any of the pages to another the background does not work prop. For example when I go from Blogs(background is right) to Blogs 1 content(background changes to the new proper one it should be) and then when I go back to blogs home(background does not change back to the right one it stays the same as blogs1 content). This is a big problem and I can not figure it out. Thank you so much for helping me! Really thank you!
alewis is offline   Reply With Quote
Old 05-28-2010, 12:06 PM   #8 (permalink)
Registered Member
 
Join Date: May 2010
Posts: 7
alewis is on a distinguished road
Default

Quote:
Originally Posted by alewis View Post
THANK YOU! You are amazing!!! I have one more question? I have created a background for each page with a different variation of my Logo. The problem is when I go from any of the pages to another the background does not work prop. For example when I go from Blogs(background is right) to Blogs 1 content(background changes to the new proper one it should be) and then when I go back to blogs home(background does not change back to the right one it stays the same as blogs1 content). This is a big problem and I can not figure it out. Thank you so much for helping me! Really thank you!
Here is the Code that I am using to bring the picture up in the background

- (void)viewDidLoad {
// Add the following line if you want the list to be editable
// self.navigationItem.leftBarButtonItem = self.editButtonItem;
self.tableView.backgroundColor = [UIColor clearColor];
self.parentViewController.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"iphone-app.png"]];
self.tableView.separatorColor = [UIColor clearColor];
}
alewis is offline   Reply With Quote
Old 05-28-2010, 07:07 PM   #9 (permalink)
Registered Member
 
kerofrog's Avatar
 
Join Date: May 2010
Posts: 63
kerofrog is on a distinguished road
Default

Quote:
Originally Posted by alewis View Post
Here is the Code that I am using to bring the picture up in the background

- (void)viewDidLoad {
// Add the following line if you want the list to be editable
// self.navigationItem.leftBarButtonItem = self.editButtonItem;
self.tableView.backgroundColor = [UIColor clearColor];
self.parentViewController.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"iphone-app.png"]];
self.tableView.separatorColor = [UIColor clearColor];
}
Hazarding a guess, your problem is most likely the use of viewDidLoad. viewDidLoad only gets called once, when the view controller is loaded for the first time. If you want this code to be called again when going back to this page, then consider using viewWillAppear method instead.

Code:
- (void)viewWillAppear:(BOOL)animated {
    // Add the following line if you want the list to be editable
    // self.navigationItem.leftBarButtonItem = self.editButtonItem;
    self.tableView.backgroundColor = [UIColor clearColor];
    self.parentViewController.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"iphone-app.png"]];
    self.tableView.separatorColor = [UIColor clearColor];
}
kerofrog is offline   Reply With Quote
Old 05-31-2010, 11:12 AM   #10 (permalink)
Registered Member
 
Join Date: May 2010
Posts: 7
alewis is on a distinguished road
Default

Quote:
Originally Posted by kerofrog View Post
Hazarding a guess, your problem is most likely the use of viewDidLoad. viewDidLoad only gets called once, when the view controller is loaded for the first time. If you want this code to be called again when going back to this page, then consider using viewWillAppear method instead.

Code:
- (void)viewWillAppear:(BOOL)animated {
    // Add the following line if you want the list to be editable
    // self.navigationItem.leftBarButtonItem = self.editButtonItem;
    self.tableView.backgroundColor = [UIColor clearColor];
    self.parentViewController.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"iphone-app.png"]];
    self.tableView.separatorColor = [UIColor clearColor];
}
Thank you~ That worked perfect for me! I really appreciate all your help!
alewis is offline   Reply With Quote
Reply

Bookmarks

Tags
color, font

Thread Tools
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
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 310
9 members and 301 guests
Abidullah, ajay123123, Fstuff, guusleijsten, HemiMG, newDev, pkIDSF, Sami Gh, Steven.C
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,648
Threads: 94,113
Posts: 402,877
Top Poster: BrianSlick (7,990)
Welcome to our newest member, brandon6031
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 07:49 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0