asset-catalog

Save image in asset catalog on runtime

﹥>﹥吖頭↗ 提交于 2019-12-01 18:22:20
I have to download new images from backend in background process and i need to save them for use later in the app. In the other way, the original app images are in the asset catalog and when i add the new ones all images must accessed from the asset catalog. I try to add images to directory's app but when i have to load any image the app do not know to discriminate between images in asset catalog and other, and i thing this is not the best solution for this I do not know how add images to asset catalog on runtime or if i have to try other way to support this. Any help i been so grateful Many

Use vector artwork for iOS launch image in asset catalog?

霸气de小男生 提交于 2019-12-01 04:38:38
Is this possible? It looks like I am going to need 9 different launch images, so replacing them all would be a bit of a chore. Unfortunately, I think you can't use vector artwork for ALL of your LaunchImages... ... but there's an approach which makes our lives easier: the new LaunchScreen.xib . In File > New, you create a new Launch Screen in User Interface: Now, you can set the new Launch Screen File in your project's target: In this LaunchScreen.xib you can put your vector artwork, using AutoLayout for adapt your vector to all screen sizes. Why I told that you can't use vector artwork for

How to access image resource in asset catalog from UIWebView (or WKWebView)

江枫思渺然 提交于 2019-11-29 05:39:34
We have a local html to show in UIWebView . And there, we want to show images that are defined in Asset Catalog. I know that we can do similar thing if we had the image flat in the main bundle. The code snippet would be like this. webView.loadHTMLString("<img src='target_image.png'/>", baseURL: NSBundle.mainBundle().bundleURL) However, I am not sure what I can specify for "target_image.png" if the png file is packaged in asset catalog. (Furthermore, we want to specify pdf to take advantage of vector image support in Xcode 6) Does anybody have any idea how to achieve this? Since the asset

Asset Catelog issue with multiple targets

旧时模样 提交于 2019-11-28 20:48:30
I have a project with multiple targets. Assume the targets are named Target-A, Target-B and so on. For every target I have a different asset catalog of App Icons. They are named as AppIcon - A, AppIcon - B and it goes on for all the targets. I have assigned respective asset catalogs to all targets, but it only shows the icons for Target-A when i run on the device / simulator. For all other targets it does not set any icons and shows iOS 7 default placeholder icon. Please help! When you are adding the app icon image please note while adding app icon-1 to Test target then select only test target

Xcode 6 device-specific asset catalog

蹲街弑〆低调 提交于 2019-11-28 17:29:04
I'm trying to update my app for the new 6 and 6+ devices. I've added launch images for the new iPhone sizes (6 and 6+). There are entries in the asset catalog for both the 6 and 6+. No problem there. I also have some full-screen view overlay images that I need to add as well. I already have images for these in @2x (iPhone 4s) and R4 (iPhone 5 5s 5c). I've created images at the new resolution sizes, but I'm not sure how to add them into an image set. When I go into the asset catalog, I can choose device-specific in the image set, and I see entries for iPhone, retina-4, and iPad. There are drag

Xcode 9 asset catalog Preserves Vector Data not working?

耗尽温柔 提交于 2019-11-28 06:56:20
I thought the new Preserves Vector Data checkmark in the Xcode 9 asset catalog would finally give us resizing of vector PDF images, but apparently not. Here's my test image seen at two zooms in Preview: Nice and sharp with lots of zoom, so clearly this is a vector image. But here's what two image views look like in my app: So where's my vector data? Is this much-desired feature still missing in action? Does it still work only for the automatically generated 2x and 3x images? And if so, what does the Preserve Vector Data checkbox give us that we didn't have already? Edit: Still the same buggy

iOS Launch screen in React Native

不打扰是莪最后的温柔 提交于 2019-11-28 02:46:06
I'm working with a React Native app and I'm trying to set a customize launch screen but I'm not able to. React Native creates a LaunchScreen.xib by default, so I've created a LaunchImage inside Images.xcassets: I've also read that I've to modify the "Launch Screen File" under "App Icons and Launch Images" in my options: Once I've done that, my launch screen became totally black and when the app is loaded, there are both top and bottom black frames: So I don't know what I have to do to set my launch screen in my React Native project. I'll be grateful if someone can help me out with those

How to access image resource in asset catalog from UIWebView (or WKWebView)

你。 提交于 2019-11-27 23:19:18
问题 We have a local html to show in UIWebView . And there, we want to show images that are defined in Asset Catalog. I know that we can do similar thing if we had the image flat in the main bundle. The code snippet would be like this. webView.loadHTMLString("<img src='target_image.png'/>", baseURL: NSBundle.mainBundle().bundleURL) However, I am not sure what I can specify for "target_image.png" if the png file is packaged in asset catalog. (Furthermore, we want to specify pdf to take advantage of

Can I access an xcassets directory on the filesystem?

北城余情 提交于 2019-11-27 14:30:50
I would like to dynamically load all images in an xcassets directory. The files are named StockPhoto# where # is the number in the list. If I can access my StockPhotos.xcassets at runtime to count all the files in the directory, I won't have to manually load the files each time I add new stock photos. If there are other solutions to this problem, I'm open to that but I'm also just very curious how xcassets are handled by the file system- whether they're just reference to a set of files, or actually their own directory. Information on this is sparse. If there are other solutions to this problem

Xcode 6 device-specific asset catalog

大城市里の小女人 提交于 2019-11-27 10:30:50
问题 I'm trying to update my app for the new 6 and 6+ devices. I've added launch images for the new iPhone sizes (6 and 6+). There are entries in the asset catalog for both the 6 and 6+. No problem there. I also have some full-screen view overlay images that I need to add as well. I already have images for these in @2x (iPhone 4s) and R4 (iPhone 5 5s 5c). I've created images at the new resolution sizes, but I'm not sure how to add them into an image set. When I go into the asset catalog, I can