Lie-An
Lie-An

Reputation: 2563

iOS 7 view background

I have settings View which is a View Object under self.view.

I added the background image as: self.settingsView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"settings_bg__650x740.png"]];

The problem is, it is having extra images at the bottom. This only happens in iOS 7.

Here's the screenshot:

enter image description here

Please, help me to solve.

Upvotes: 0

Views: 650

Answers (3)

Wubao Li
Wubao Li

Reputation: 1748

the settings view's bound size is higher than the background color referred image. so, the image will tile to fill the settings view.

Upvotes: 0

sailaopoeng
sailaopoeng

Reputation: 78

try resize your image before adding to background.

You can find answer in here Stretching a image in iOS using colorWithPatternImage

Upvotes: 0

rmaddy
rmaddy

Reputation: 318804

The image is being tiled. Why are you creating a tiled image and using it as a background color? Just put the image in a UIImageView and add the image view to the view.

Upvotes: 1

Related Questions