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 02-14-2009, 02:32 PM   #1 (permalink)
New Member
 
Join Date: Feb 2009
Posts: 9
arash is on a distinguished road
Question Background image TableCell problem when using custom cell

I am trying to set a background for a table (that has a custom cell).
I used this code to set the background for the table in viewdidload method:

UIImage *patternImage = [UIImage imageNamed:@"Background.jpg"];
[self.tableView setBackgroundColor:[UIColor colorWithPatternImageatternImage]];


I tried to made my custom cell transparent (by setting color to clearColor , and also changing the values of opaque and alpha ) no luck !

attached you can find the screen shot!

I really appreciate any help on this ,
Thanks in advance.
Attached Images
File Type: gif myScreen.gif (15.8 KB, 65 views)
arash is offline   Reply With Quote
Old 02-15-2009, 07:54 AM   #2 (permalink)
Registered Member
 
Join Date: Dec 2008
Posts: 495
exorcyze is on a distinguished road
Default

Did you try setting the cell.contentView background as well to opaque=NO and backgroundColor = clearColor?
__________________
My Apps on AppStore : gScale (guitar scales reference), eMaze, eMaze Lite, eTimesheet
exorcyze is offline   Reply With Quote
Old 02-16-2009, 08:57 AM   #3 (permalink)
New Member
 
Join Date: Feb 2009
Posts: 9
arash is on a distinguished road
Exclamation No luck!

Thanks exorcyze,

I've tried

self.contentView.backgroundColor=[UIColor clearColor];
self.opaque=NO;
self.backgroundColor=[UIColor clearColor];

in initWithFrame of my Custom Cell

and also in cellForRowAtIndexPath of my Controller
cell.contentView.backgroundColor=[UIColor clearColor];
cell.opaque=NO;
cell.backgroundColor=[UIColor clearColor];

I've also tried to set the color of my custom cell to red through the code
self.backgroundColor=[UIColor redColor];
cell.backgroundColor=[UIColor redColor];

It didn't work (I didn't see any changes), but I was able to do the same task through the xib by setting the background color

any suggestion would be appreciated.

Regards,
Arash from toronto
arash is offline   Reply With Quote
Old 02-16-2009, 02:18 PM   #4 (permalink)
Registered Member
 
Join Date: Dec 2008
Posts: 495
exorcyze is on a distinguished road
Default

I tried setting the following items in my cellForRowAtIndexPath:

Code:
cell.opaque = NO;
cell.contentView.opaque = NO;
cell.backgroundColor = [UIColor clearColor];
cell.contentView.backgroundColor = [UIColor clearColor];
And the background of my table was showing through just fine. The only difference being I had a custom cell that had labels I created on it, so I needed to make sure those were transparent in my custom table cell view. =)
__________________
My Apps on AppStore : gScale (guitar scales reference), eMaze, eMaze Lite, eTimesheet
exorcyze is offline   Reply With Quote
Old 02-17-2009, 05:47 PM   #5 (permalink)
New Member
 
Join Date: Feb 2009
Posts: 9
arash is on a distinguished road
Talking Thanx for your help

Hi exorcyze,

Just wanted to let you know that , I finally found a way to accomplish the task
by creating everything by code without using the nib files.

Please disregard my PM.
Thanks again for your time/help.

Regards,
Arash
arash is offline   Reply With Quote
Old 02-18-2009, 01:23 AM   #6 (permalink)
Registered Member
 
Join Date: Dec 2008
Posts: 495
exorcyze is on a distinguished road
Default

Glad you got it sorted! =)
__________________
My Apps on AppStore : gScale (guitar scales reference), eMaze, eMaze Lite, eTimesheet
exorcyze is offline   Reply With Quote
Old 11-10-2009, 04:50 AM   #7 (permalink)
Registered Member
 
Join Date: Nov 2008
Posts: 13
markdude is on a distinguished road
Default there's a bug on XIB designer

when sometimes background of cell (using IB) does not change even when selecting color diffrent than white.
I could not solve it even when looking into xib source and I think I'll have to delete the xib and create it again.
markdude is offline   Reply With Quote
Reply

Bookmarks

Tags
table

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: 326
5 members and 321 guests
Anwerbl, guusleijsten, HowEver, LEARN2MAKE, mottdog
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,649
Threads: 94,113
Posts: 402,879
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Anwerbl
Powered by vBadvanced CMPS v3.1.0

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