In my iPad app which is restricted to UIInterfaceOrientationLandscapeRight , i added splash image by named default-Landscape.png & default-Landscape#2x.png images but it is rendering in simulator but not in my iPad.
All file names are case-sensitive.
rename them to : Default-Landscape.png & Default-Landscape#2x.png
with capital "D"
in simulator it isnt case-sensitive but in device it is
hope it helps. happy coding :)
I assume you mean the Default image.
Go to the Target - Summery view and check the the image is set for "Launch Images" and that there is no error or warning (usually due to size issue, you will see a small yellow mark over the picture)
deleted the app from both device and simulator
Clean your product
and reinstall on device via xcode.
Assuming you still have a problem, try to open the original image in Photoshop and re-export it as PNG 24
Refer Automatic orientation support for iPhone and iPad apps By Apple
iPad-only applications:
Create a launch image for each supported orientation in the PNG format. Each launch image must be 1024 x 748 pixels (for landscape) or 768 x 1004 pixels (for portrait).
Default launch image files:
Default-PortraitUpsideDown.png - upside-down portrait version.
Default-LandscapeLeft.png - left-oriented landscape version.
Default-LandscapeRight.png - right-oriented landscape version.
Default-Portrait.png - generic portrait version.
Default-Landscape.png - generic landscape version.
Default.png - default portrait launch. Its usage is strongly discouraged, use more specific launch images instead.For iPad launch images, do not include the status bar region.
Create launch images of these sizes:
For portrait:
768 x 1004 pixels
1536 x 2008 pixels (high resolution)
For landscape:
1024 x 748 pixels
2048 x 1496 pixels (high resolution)
This happened to me with an Ionic 3 app. Eventually I discovered the image it was loading is Default#2x~universal~anyany.png
Related
I am completely new for Image assets in xcode. I am creating a sample project, In that I have story screen, It contains the UIPageViewController with images. I added 320*480px,750*1134px,1242*2208px images. In portrait modeworking fine, But the problem is, If I rotate the device from stretching to landscape the image is stretching. I tried with xcode image assets options. I saw different sizes(Refer image) while selecting the width and height like Any&compact, Any&Regular etc. I am not able to understand what are the size to add at 1*,2*,3*.
More details:
project supported version is iOS >=8. support iPhone and iPad both landscape and portrait.
Do we need to add all these images.
If we use iPhone and iPad, Why we need to use width and height attributes.
Can you help me.
Any one explain the below image and it's sizes.
I suppose iPhone 6 Plus is with 1242x2208px. Thus, my #3x images are scaled according to this ratio.
When applied, the image is much bigger than it's displayed on iPhone 6 and iPhone 5 with corresponding #2x images. I wonder why?
below is an example - the last icon is using #3x while the first three are stretched from #2x images.
After being struggling for days, I finally found the problem.
It turns out that, you have to set LaunchImage sets to fit each device screen appropriately. Otherwise, Apple will assume your app is not ready for iPhone 6 and 6 Plus yet, thus stretching your image assets to fit the screen. So even when I set the high resolution images, it still recognise it is for iPhone 5S and below.
The solution is, create a LaunchImage asset catalog, make sure you have the right resolution of launch images for each device. for iPhone 6 and 6 plus, you these additional assets:
Default-667h#2x.png - 750 x 1334
Default-736h#3x.png - 1242 x 2208
Default-736h-Landscape#3x.png - 2208 x 1242
And then, in your project setting > General > App Icons and Launch Images, make sure you are using asset catalog and choose the correct LaunchImage set.
Hope this helps.
Note that this probably only bothers those who are not using Storyboard but pure code to manage UI.
Additional Note: I encountered cache problem with Xcode 6 and simulator. When you update image and it doesn't take effect, try goto Simulator > Reset Content and Settings OR in your Xcode press cmd + alt + shift + K
How can one create a iOS7 Icon in Images.xcassets with Xcode5? I've searched many places, but i did not find what the required Icon sizes were.
My App is for iOS7+.
Here is a screenshot:
I've added some icons below in the AppIcon.appiconset folder in mac. Do I need to add in the xcode side bar? What are the required sizes for the AppIcon.appiconset folder?
This is very easy & in-fact it is self explanable. You need not even have to think about the name of the icons. The only thing that you need to worry about is the sizes. Here is how to infer the sizes out of that screen.
BASIC RULE : Multiply the 1x or 2x shown in the empty box with the pt value under it. When there are two boxes like 1x & 2x for the same pt value, let's say 40pt, it means you have to provide both the sizes of images. 40x40 & 80x80 .
Make sure if your app is Universal or Device specific. Based on that, you need to provide the icons.
Point to be noted Images.xcassets doesn't sizes your files. It is just a catalog where you add the files of specific sizes.
Now let's say you have a myIcon.png file of a bigger size (its always better to create your app icon with a size of 1024x1024, if not then at least 512x512).
Open the Images.xcassets & now read each empty icon elements. There is the size name provided, already.
NOW CONCENTRATE : If empty dasshed box reads as 2x & text below reads as iPhone Spolight - iOS 5,6 Settings - iOS 5-7 29pt, then it is actually seeking an image double the size of 29pt, So you need an image size of 58x58
You just need to re-size your actual image using any editor (previewer is the best editor) & create the specific size. Save it some where & drag upon that specific Box.
You are done.
Here is a sample to read it. Hope that makes all your doubt clear going forward.
You need not have to worry about naming conventions of images when using Images.xcassets
Once you have all your images ready, just drag & drop it into the Images.xcassets in Xcode itself. Make sure you are dropping it into AppIcon category. Similarly you need to do things for LaunchImage as well if you are interested.
AppICon Sizes - XCAssets - Xcode 6.4
iPhone Spotlight
iOS 5-6 - 29pt
29*29 -1x,
58*58 - 2x,
87*87- 3x
iPhone Spotlight
iOS 7,8- 40pt
80*80 - 2x,
120*120 - 3x
iPhone App
iOS 5,6 - 57pt
57*57 - 1x,
114*114 - 2x
iPhone App
iOS 7,8 - 60pt
120*120 - 1x,
180*180 - 2x
iPad Settings
iOS 5-8 - 29 pt
29*29 -1x,
58*58- 2x
iPad Spotlight
iOS 7,8 - 40pt
40*40 -1x,
80*80 - 2x
iPad Spotlight
iOS 5,6 - 50pt
50*50 -1x,
100*100 - 2x
iPad App
iOS 5,6 - 72pt
72*72 -1x,
144*144 - 2x
iPad App
iOS 7,8 - 76pt
76*76 -1x,
152*152 - 2x
What size should an application icon and menu bar icon for OS X be?
I can deal with small resolution displays but what about Retina - does an icon displayed on the menu bar (e.g. 20 x 20 ) will be smaller or blurred on a new MacBook Pro with Retina display?
I reckon that the Application icon will be scaled, so if I'll prepare twice larger than regular it should be OK on Retina.
I found an excellent guide for iOS development with sizes specification but I can't find similar size specifications for OS X.
NSStatusBar icons (i.e. Menu bar icons) are different from regular app icons. I have not been able to find an NSStatusBar official icon guideline, but I have to believe that the Toolbar Icon guideline for buttons is pretty close. It suggests:
Create icons that measure no more than 19x19 pixels.
Make the outline sharp and clear.
Use a straight-on perspective.
Use black (add transparency only as necessary to suggest
dimensionality).
Use anti-aliasing.
Use the PDF format.
Make sure the
image is visually centered in the control (note that visually
centered might not be the same as mathematically centered).
In testing, I've found:
NSStatusBar seems to look best with something 18 pixels high, or less. The systemStatusBar has a thickness of 22.
While it lists PDF format, I've been using png without issue.
If you want your icon to be white on blue when it's selected, you need to provide the alternateImage as a separate white version of your icon.
Code sample:
myStatusItem = [[NSStatusBar systemStatusBar]statusItemWithLength:NSSquareStatusItemLength];
NSImage *statusImage = [NSImage imageNamed:#"Status.png"];
[myStatusItem setImage:statusImage];
NSImage *altStatusImage = [NSImage imageNamed:#"StatusHighlighted"];
[myStatusItem setAlternateImage:altStatusImage];
[myStatusItem setHighlightMode:YES];
[myStatusItem setMenu:self.myStatusMenu];
To make your menu item support Retina displays, Dark Mode and different states (e.g. pressed)
Create two PNG images sized 16x16 and 32x32 pixels
Create a new image asset in Xcode with Render As set to Template Image and add your images for 1x and 2x
Initialize your NSImage from the image asset without changing its size: NSImage(named: "Example")
http://developer.apple.com/library/mac/#documentation/userexperience/conceptual/applehiguidelines/Intro/Intro.html#//apple_ref/doc/uid/TP30000894-TP6
And:
http://developer.apple.com/library/mac/#documentation/userexperience/conceptual/applehiguidelines/IconsImages/IconsImages.html
Follow these steps and you will get a perfectly sharp status bar Icon for retina
Open a png file of your Icon in photoshop it should be larger than 88px x 88px
go to menu, Image, Image size
set resolution to 350
set size to 88px x 88px (pixels)
save image as png
add it xcode
adding on to Michael's answer apple are now requiring all the way up to 1024x1024px icons due to retina displays.
http://www.cultofmac.com/179738/apple-now-requires-high-res-1024x1024-icons-for-every-mac-os-x-app/
The maximum size for the app icon should be 1024 x 1024.
And you have to create both regular and retina resolution icons for 16 x 16, 32 x 32, 128 x 128, 256 x 256, 512 x 512 & 1024 x 1024.
The details for which you can find in the "High Resolution Guidelines for OS X" document from Apple.
I have a PNG picture which I should use in my iPhone application, but first of all, I have to give it the dimensions of an iPhone 4 retina screen. Does any one know what could it be its dimensions or how to do that?
The retina display on the iPhone 4 has the double amount of pixels than that of an older iPhone. So the complete size of an iPhone 4 screen in pixels is 640x960.
In photoshop you can quickly resize any image by changing the image size property from the Image menu. If you don't want to lose quality I suggest you start with all retina images and halve them for the non retina displays. Doing it the opposite way will decrease your quality.
If you want to use an image designed for the iPhone 4 retina display you'll want to have both pictures, one for the normal iPhone screen (320x480) and one for the retina images, in your resource's folder of your Xcode project. Use the same name for those images but append "#2x" at the end of the retina images.
So if you have a "background.png" it will become "background#2x.png" and iOS will be smart enough to use the correct image for the correct type of screen.
At 72 dpi, it should be 640px by 960px.
iPhone4 screen resolution is 960x640