iOS轻薄亚麻背景? [英] iOS light linen background?
问题描述
我真的想知道是否有办法获得iOS的轻薄亚麻背景。这是它的样子:
I really want to know if there's a way to get iOS's light linen background. Here's what it looks like:
有没有办法只使用内置的SDK来访问它?或者我必须在某个地方找到这样的图像?
Is there a way to access this by merely using the built-in SDK? Or do I have to find an image like this somewhere?
编辑:我没有'我想使用私有API,所以这就是我所做的。我以这种方式抓取图像:
I didn't want to use private APIs, so here's what I did. I grabbed the image this way:
CGRect rect = CGRectMake(0.0f, 0.0f, 640.0f, 960.0f);
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(context, [[UIColor underPageBackgroundColor] CGColor]);
CGContextFillRect(context, rect);
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *imagepath = [documentsDirectory stringByAppendingPathComponent:@"underPageBackground.png"];
[UIImagePNGRepresentation(image) writeToFile:imagepath atomically:YES];
以下是视网膜分辨率产生的png :(点击缩略图打开)
And here is the resulting png in retina resolution: (click on thumbnail to open)
希望这对某人有用。 :)
Hope this is useful to someone. :)
推荐答案
使用 [UIColor underPageBackgroundColor]
。这里有链接,其中包含有用的信息和样本。
Use [UIColor underPageBackgroundColor]
. And here is a link with useful information and samples.
这篇关于iOS轻薄亚麻背景?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!