Ad
IOS9 And InitWithPattern With IPad Pro Causing Repeating Background
I now upgraded to iPad Pro simulator for iOS9 and now I am getting a repeating background. Is there something new I must do in order to get the image to correctly expand on iPad Pro. My image sizes dont have a new launch image so I am lost on this.
- (void)addBackgroundImage:(NSString*)imageName {
UIColor *image = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:imageName]];
self.view.backgroundColor = image;
}
Ad
Answer
Try to use the CGImage
in background to avoid repeating background.
Objective-C
self.view.layer.contents = (__bridge id _Nullable)([UIImage imageNamed:@"backgroundImageAsset"].CGImage);
Swift
self.view.layer.contents = UIImage(named:"backgroundImageAsset").CGImage
Ad
source: stackoverflow.com
Related Questions
- → Function Undefined in Axios promise
- → What are the pluses/minuses of different ways to configure GPIOs on the Beaglebone Black?
- → Click to navigate on mobile devices
- → Playing Video - Server is not correctly configured - 12939
- → How to allow api access to android or ios app only(laravel)?
- → Axios array map callback
- → Access the Camera and CameraRoll on Android using React Native?
- → Update React [Native] View on Day Change
- → Shopify iOS SDK - issue converting BuyProductVariant to BuyProduct
- → BigCommerce and shopify API
- → Warning: Each child in an array or iterator should have a unique "key" prop. Check the render method of `ListView`
- → React Native - Differences between Android and IOS
- → What is the difference between React Native and React?
Ad