I'm developing my first real flutter project and I have a question about assets. Can I use platform assets to load my app icons? If no, I need create flutter assets to my app. But, what is recommended size to general icons?
Flutter doc say:
Main assets are presumed to match a nominal pixel ratio of 1.0. To specify assets targeting different pixel ratios, place the variant assets in the application bundle under subdirectories named in the form "Nx", where N is the nominal device pixel ratio for that asset.
But Android and IOS have many screen sizes. Using platform assets I create all icons according platform specification. So how I do in flutter? What are the specifications of general purpose icons?
Thanks!
If these are simple icons, then using an icon font, in the same manner as the built in IconData, should obviate any concerns about scaling, since they are vector-based.
If you have (or can convert) your icon assets as SVG, then you can easily build Flutter icon fonts using http://fluttericon.com. This will generate a TTF font and Dart code for your custom icons.
Related
I was hoping I could use SVG icons on a tab bar. I'm currently using Xcode 12 beta 3 and whilst it works with these images, the icons don't seem to rescale.
Is there a solution to this?
A few observations:
See the Creating Custom Symbol Images for Your App for suggestions on how to build symbol SVG assets.
Historically in Xcode, we couldn’t easily use SVG assets. But we could convert them to PDFs, which we could then drag into our asset catalogs. When you use the asset in the app, it still ends up rasterizing it, which it saves you from having to create bitmaps of the three different sizes yourself. If you need to make it scalable (e.g., notably, for accessibility), check the “preserve vector data” option in the asset catalog.
In Xcode 12 (only beta right now), the importing of SVG assets has greatly improved. It still appears to rasterize the asset when you go to use it, though, just like the old PDF approach. You need to make sure your SVG/PDF has an artboard of the appropriate size for the eventually rasterized images.
If you consider these various vector graphic solutions, make sure to test this on your target minimum OS before you go too far. I had app with vector/PDF assets and got some unexpected edge-case behaviors on old OS versions.
I am developing a iOS/Android app using React Native. According to the documentation at this link https://facebook.github.io/react-native/docs/images
React native places the correct image size according to your device screen density.
When developing I do as the tutorial on the link above but react native bundles de img.png always and doesn't place the #2x or #3x image which are bigger.
I don't know if this is only done when the bundle is created for launching the app or so! Please help, I am struggling
Also, which is the better flux, process or way to design one screen size in psd and get all assets for multiple screen sizes from it?
Thanks in advance
as react-native doc image should be named accordingly
in development mode images will be bundled to app but you can link images in native project folder as drawable in android
so if you use different builds for your app you will use that density images
ps : a dirty workaround inorder to test your app in dev mode is, providing other image for #2x or #3x image sizes
I had the same issue - my #2x and #3x images weren't being loaded when I compiled and ran my app on phones with those screen densities, after I added them to the project.
But when I stopped and closed the bundler (terminal) and restarted it (new terminal window), it packaged and displayed the correct density images on the correct devices' screens.
I am using 24x24 pixels icons in my xamarin forms ios project, but not getting good clarity. So I modified all the icons with 32x32 pixel size. Icons sizes are increased but still getting poor clarity.
So which resolution icons are good for xamarin forms IOS project?
For me it has proven to be good practise to add an image in three versions.
A "small" version, being used on non-retina devices, though that is kind of legacy support by now, a "medium" version for usual retina displays and a "large" one for higher ones.
If you name your files properly, xamarin.iOS will automatically choose the right file for the current device.
For instance, I have a file "fa_home.png" with a resolution of 25x25px, "fa_home#2x.png" in 50x50 and "fa_home#3x.png" in 75x75.
Just add the files to your project and reference the first one without the #2x or #3x addition in the name.
For Android , I am using the following sizes:
drawable - 72x72
drawable-hdpi - 72x72
drawable-xhdpi - 96x96
drawable-xxhdpi - 144x144
I've started developing an iOS app, adding pictures in resolution which is ok for standard retina screens. Now I want to add #3x pictures for iphone 6 plus and 7 plus. I don't want to include 1x version for older devices. I've renamed all image files to name#2x but these are not recognized in the project anymore. I was thinking that #2x name modifier will be ignored, but this is not the case. Do I need to explicitely add "#2x" in all places I'm referencing these pictures in the code? Or should I leave standard retina versions without any name change and these will be used anyway as #2x and only use #3x name modifier for higher resolution versions?
Use asset catalogs. See Apple Documentation
Then it's really easy to define 1x, 2x and 3x images by drag&drop. If you load the image in code by name (without scale) it works like a charm. If 1x is missing the next possible image will be used automatically.
You can import pdf-images or well known as vector-images as single vector in assets.Hence No need of 1x,2x,3x seperatly.
You can use Blade
Better asset workflow for iOS developers. Generate Xcode image catalogs for iOS / OSX app icons, universal images, and more.
with a definition file like this will generate all the images for you and put it in the right place
blades:
- source: store/slice1.png # this image should be the only image, and the biggest image you can use (typically for icons, 1024x1024)
mount: Project/Assets.xcassets/AppIcon.appiconset
I created phonegap app for both android and IOS using eclips and xcode4.5
The size of Andorid app is 650KB
The size of IOS app is 9MB!!!
I created empty phonegap app (just did create on terminal) and got the same size
How can I reduce the IOS application size ?
Thanks!
The standard iOS App includes lots of Artwork, e.g. for the CDVCapture plugin.
If you don't use the Capture API (which is likely), you could save 2.3MB by deleting the Capture.bundle in the Resources folder and removing CDVCapture from the Plugins list in the Cordova.plist.
Of course much of the filesize is caused by the various splash screens, icons and maybe artwork you use yourself. There is a very good way to minimize the cost of these. Get ImageOptim and drop your Xcode project folder on it. This will reduce the filesize of your images dramatically (without losing quality). One last step: Xcode recompresses all of the artwork, so they have a bigger filesize again (stupid, right?). Go to the Build Settings tab and type PNG into the search field. Set Compress PNG files to NO.
further reading on imageoptim & Xcode
The whole process should reduce your App by at least 50%, please report back how much you could achieve, thanks.
That would be the retina splash screen images.
10MB is a normal app size, don't worry about it.