asset-catalog

How do I load an image from the Asset Catalog on cross-platform xamarin XAML?

两盒软妹~` 提交于 2019-12-05 18:47:39
It seems like a really easy thing to do, and in theory it looks very straight forward: create the Asset Catalog add an Image Set and name it "imageName" (without .png) add the images done or at least that's what i read pretty much everywhere, but I still can't get it to work. My XAML looks like this: <?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:CrossBaiscs" x:Class="CrossBaiscs.MainPage"> <ContentPage.Content> <StackLayout BackgroundColor="Orange"> <Label Text

Asset Catalog not being used in project

扶醉桌前 提交于 2019-12-05 17:54:15
问题 I have a project using an asset catalog and recently without any change on my part, the images are just not displaying. It displays this error: 2014-06-23 21:41:02.824 Project[8247:464100] CUICatalog: Can't find rendition for name: menu scale factor: 2 device idiom: 1 device subtype: 568 2014-06-23 21:41:02.825 Project[8247:464100] Could not load the "image" image referenced from a nib in the bundle with identifier "com.sieradzki.Project" I know this has already been answered here: Asset

Getting video from Asset Catalog using On Demand ressources

大城市里の小女人 提交于 2019-12-05 12:30:32
I attributed to my .mp4 video the "tokyo" tag for example, and set it as installed during the app installation. Now before I was using a Path to get it from my resources, now it's different because it's located on the Asset Catalog. After found documentations, I tried something like : NSBundleResourceRequest(tags: ["tokyo"]).beginAccessingResourcesWithCompletionHandler { (error) -> Void in let tokyoVideo = NSDataAsset(name: "tokyo") So I can do : tokyoVideo.data to access NSData but I'm using AVPlayer which take in parameter an NSURL, not data. So what can you suggest me for getting a NSURL of

How do you use an asset catalog image's slicing information programmatically?

冷暖自知 提交于 2019-12-05 11:46:36
I used to have an image in my project and I would load it like this: UIImage *image = [[UIImage imageNamed:@"image_name"] resizableImageWithCapInsets:UIEdgeInsetsMake(10.0f, 10.0f, 10.0f, 10.0f)]; Now I put that image into XCode 5's new asset catalog and I set the slicing for it. How do I use that image in my code so that I don't have to explicitly call resizableImageWithCapInsets when loading the image? Said another way, how do I take the slicing information stored in Images.xcassets and store it in a UIImage 's capInsets property? Or am I thinking about this all wrong? Ok, I was able to

Differentiating images in an asset catalog by their group

删除回忆录丶 提交于 2019-12-05 04:52:44
Is there any way to use asset catalog groups to effectively namespace multiple images with a shared name? For example, if I have multiple images named Foo that are in different groups, is there a way to specify which one I would like with imageNamed: (i.e. something like UIImage(named:"Group1.Foo") ). Obviously I could create unique names myself for all images, but it would be nice if there was a way to leverage groups to do it for me. Select each folder in your asset catalog that you'd like to add a namespace for. Go to the folder attributes and select under the name "Provides Namespace".

CUICatalog: Invalid Request: requesting subtype without specifying idiom (Where is it coming from and how to fix it?)

99封情书 提交于 2019-12-04 22:26:22
When I run my SpriteKit game, I receive this error multiple times in the console. As far as I can tell (though I'm not completely sure), the game itself is unaffected, but the error might have some other implications, along with crowding the debug console. I did some research into the error, and found a few possible solutions, none of which seem to have completely worked. These solutions include turning ignoresSiblingOrder to false , and specifying textures as SKTextureAtlas(named: "atlasName").textureNamed("textureName") , but these did not work. I think the error is coming somewhere from the

Asset Catalog Error: CUICatalog: Can't find rendition for name

亡梦爱人 提交于 2019-12-04 11:55:10
All of a sudden, and through no apparent changes on my end, I am now getting the following error from an image in my asset catalog: 2013-10-30 14:44:46.629 MyApp[38590:a0b] CUICatalog: Can't find rendition for name: LoginBackground scale factor: 2 device idiom: 1 device subtype: 0 2013-10-30 14:44:46.638 MyApp[38590:a0b] Could not load the "LoginBackground" image referenced from a nib in the bundle with identifier "com.mybundleid" I have tried removing the image assets and re-adding them, to no avail. The issue is happening in the simulators as well as devices. And oddly enough I can still see

App thinning without @3x images and when some images are JPGs

…衆ロ難τιáo~ 提交于 2019-12-04 09:22:19
For an upcoming update to one of my apps I have packed all the image resources into Asset Catalogs. However, at the moment I do not have @3x version for most of my images. I have checked with the simulator and on iPhone 6 Plus @2x versions are used. I don't mind this behaviour for two reasons: The result is good enough for images which I am using Only 50% of my users are using iOS 9. If I add @3x images the size of my app will skyrocket for those on older OS Although images load correctly in the Simulator for iPhone 6 plus, I am a bit worried about what happens when I archive my app. In

Does Both Referencing an Asset Catalogue and Including it from a Framework Create Duplication?

旧城冷巷雨未停 提交于 2019-12-04 05:26:26
问题 As discussed here & here, the only apparent way to host re-usable images in a Framework's .xcassets file, then use those images in the storyboard / XIB of an app, is to manually create a reference to that catalog file directly within the app's project. This puts the assets within the app's main bundle, and avoids this error when trying to use them via Interface Builder: Could not load the "ImageName" image referenced from a nib in the bundle with identifier "BundleName" My question, though,

Opt into app thinning for icons in asset catalog in existing project

久未见 提交于 2019-12-04 05:15:46
At WWDC 2017 Session 201 What's New in Cocoa Touch , around the 33:50 mark, it is stated that "By incorporating [icons] in Asset Catalogs, we're now able to have them participate in the app thinning, which will significantly lower your app's footprint. So, this is a really exciting thing to adopt, and it will be adopted by default in new projects in iOS 11. You can opt into it in existing projects by adding a key to your Info.plist." What is the key you need to add in your Info.plist to enable app thinning for icons in Assets Catalogs in your existing projects? I'm not seeing it defined in the