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 01-06-2011, 08:24 PM   #1 (permalink)
Registered Member
 
Join Date: Nov 2010
Posts: 59
kend0g187 is on a distinguished road
Default Custom Table View Cell w/ background image - width problem

I have a custom cell (set up in IB) with a background image of width 320px. The width of the cell is also 320. When I run my app, there is about 5 pixel of white on the right side of the cells. In other words, my image doesn't cover the entire width of the screen. My code looks like this:

Quote:
- (UITableViewCell *) tableView: (UITableView *) tableView cellForRowAtIndexPath: (NSIndexPath *) indexPath {
static NSString *OffensivePlayerCellIdentifier = @"OffensivePlayerCellIdentifier";
OffensivePlayerCell *cell = (OffensivePlayerCell *)[tableView dequeueReusableCellWithIdentifier: OffensivePlayerCellIdentifier];
if( cell == nil ) {
NSArray *nib = [[NSBundle mainBundle] loadNibNamed: @"OffensivePlayer" owner: self options: nil];
cell = [nib objectAtIndex: 0];
}
return cell;
}
Any ideas?
kend0g187 is offline   Reply With Quote
Old 01-06-2011, 08:40 PM   #2 (permalink)
Indie Developer
 
iSDK's Avatar
 
Join Date: Jul 2010
Posts: 1,346
iSDK is on a distinguished road
Send a message via AIM to iSDK
Default

you can try and make the image 5px taller and 5px wider?
Quote:
Originally Posted by kend0g187 View Post
I have a custom cell (set up in IB) with a background image of width 320px. The width of the cell is also 320. When I run my app, there is about 5 pixel of white on the right side of the cells. In other words, my image doesn't cover the entire width of the screen. My code looks like this:



Any ideas?
iSDK is offline   Reply With Quote
Old 01-07-2011, 03:55 PM   #3 (permalink)
Registered Member
 
Join Date: Nov 2010
Posts: 59
kend0g187 is on a distinguished road
Default

Well, instead of applying the image directly to the background of the cell, I tried adding an image view and applying the image to that. Now it works. Don't know why. Strange behavior.
kend0g187 is offline   Reply With Quote
Reply

Bookmarks

Tags
uitableviewcell, width

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: 364
7 members and 357 guests
blueorb, fredidf, iAppDeveloper, iGamesDev, mottdog, sacha1996, Touchmint
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,667
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, host number one
Powered by vBadvanced CMPS v3.1.0

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