zero3nna
zero3nna

Reputation: 2918

Use a UIImageView to draw a background image for UITableView results in artefacts

I'm very new to Xcode and not familiar with all functions. I simply would like to have a background image underneath my UITabelView. There are many answers to this problem, but all of them give me these white artefact borders. So my question is, did anybody end up with the same problem and solved it? To get an idea, imag is attached below.

Thx for any help!

Here just a quick view over my implementaion

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:
(NSDictionary *)launchOptions{

  self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
  // Override point for customization after application launch  
  //initialise main views
  UIImageView *backGround = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 
  self.window.bounds.size.width, self.window.bounds.size.height)];
  [backGround setImage:[UIImage imageNamed:@"Default.png"]];
  [self.window addSubview:backGround];
  LoginViewController *loginViewController = [[LoginViewController alloc] 
  initWithNibName:@"LoginViewController" bundle:nil];
  self.navigationController = [[UINavigationController alloc] 
  initWithRootViewController:loginViewController];
  self.window.rootViewController = self.navigationController;
  self.window.backgroundColor = [UIColor whiteColor];
  [self.window makeKeyAndVisible];

  return YES;
}

enter image description here





[Same Problem on antoher UI Item]

Now I have the same problem on my programmatically created UIButtons with rounded rect. But I have no idea how to get rid of them?

Upvotes: 0

Views: 232

Answers (2)

Mohammad Rabi
Mohammad Rabi

Reputation: 1412

I face this problem before

i think u set your tableview separator property to Single Line Etched style, to solve this problem set your tableview separator in cellforrowatindexpath delegate :

tableview.separatorStyle = tableview.UITableViewCellSeparatorStyleSingleLine;

or

tableview.separatorStyle = tableview.UITableViewCellSeparatorStyleNone;

or u can set it in xib file under separator section.

may help you

Upvotes: 1

Sascha
Sascha

Reputation: 21

Just a thought... But you take the size of [UIScreen mainScreen]. Since you have the ApplicationBar enabled your windows is 20px smaller in height...(?)

Upvotes: 0

Related Questions