Why does iPad preview use wrong image? - xcode6

My question is, why does the iPad preview use a different image than the storyboard for wRegular hAny?
I'm trying to set up a universal app with a menu that will use larger buttons for iPad. In the asset catalog, I've specified the standard image size for wAny x hAny, and loaded a larger image for wRegular x hAny.
The story board looks fine for all size classes, with the wRegular x hAny using the iPad image, and everything else using the iPhone image. But the previews all use the iPhone image, including the iPad preview, despite the storyboards showing the correct images. In the screen shots below, the story board is shown to the left, preview to the right.
Can someone tell me what I'm doing wrong here? I'm trying to avoid using explicit image sizes for each class - is that what I should be doing?
Any help would be greatly appreciated. I've read everything I can on using different image sizes, and still cannot figure this out.
enter code here

You can't have a different images by size class for the same button in Interface Builder. It looks to me like you set the image of the button to be the iPad one first in Regular/Any, then set the iPhone one afterward in Any/Any which changed what you did in Regular/Any.
In this image, see how the Font has a + symbol to the left of it, but Image doesn't? That's for specifying the value per size class. Since Image doesn't have that, it's not a value saved for the specific size class.

Related

tableView's cell to fit image (vertical or/and horizontal)

I use PFQueryTableViewController to download photos from Parse.com. As the uploaded images are from different devices (iphone 5, iPhone 6, iPhone 6 plus,...) and are of different aspects (horizontal or vertical) i've faced an issue of how to make them all fit in the tableView cell. I know that it is possible to crop photos before they are uploaded (like instagram) but i'd love to save their original size and aspect seeing that it is possible and is used in some apps.So I want to know your advices about:
1) what shall I use to display image (cell's background or imageView) ?,
2) how to make cell fit the image? Now i have it like that Screenshot even with left margin (no idea why it is applied to imageView, not to the label?).

iOS UI Custom button images

I'm developing a iOS app that is using custom UIButtons with round shape. I wanted to add Image to these buttons and would like to know if I use IB to select an image from my project, do I have to also worry about 2x retina images for retina display?. What should be the image size for both non-retina and retina devices (all iPhones (including iphone 5) and iPad including mini) when I embedded them from IB?
Is there a best resource available on the Internet to get these pngs files for buttons?
Yes you should use all the images. you should just add the images with proper names to the resources folder. And just select the non-retina image rest the compiler will take care of.
http://www.idev101.com/code/User_Interface/sizes.html
The above link will help you with the images sizes
It is easy. Goto interface builder and on the right hand panel you will see this -
All you need to do is first configure your button as custom then include a image file in your project through xcode and then you can select that image in the dropdown in background or image property.
Note that all this is possible to do through code also, its just that IB makes it interactive. Hope this helps.

Retina graphics vs non-retina graphics management

I am about to launch a new app and would lik eto increase quality of the graphics. In my case the graphics is the logo and the custom buttons. I do not know if this impact Core Plot but that is also part of the package.
There is quite a few posts about this but there are still things i do not fully understand.
I am reading this quote from "amattn":
It's trivial:
1.Only include #2x images in your project.
2.Make sure those images have the #2x suffix.
The system will automatically downscale for non-retina devices.
The only exception is if you are doing manual, low level Core Graphics drawing.
You need to adjust the scale if so. 99.9% though, you don't have to worry about this.
From this post: Automatic resizing for 'non-retina' image versions
My question in regards to this is:
1. Should i do the testing on retina simulator only, as if i place a #2 grapic on
non-retina it will be too big? ...or is there an other way of doing it?
2. Should i always use a ImageView or is it OK to drag the image on the screen,
this is the logo i am talking about?
3. What about custom made buttons with images, how should i do with those?
4. What is the normal process to manage the different screen sizes, do people
add images for all displays or using this type of process?
Should i do the testing on retina simulator only, as if i place a #2 grapic on non-retina it will be too big? ...or is there an other
way of doing it?
It doesn't really matter which simulator you test on because as long as your non-retina and retina graphics are named correctly (image and image#2x) the correct image will be displayed automatically.
Should i always use a ImageView or is it OK to drag the image on the screen, this is the logo i am talking about?
When you drag and image from the project directly onto a view in interface builder you don't really see it happen but it has automatically created and image view which is containing the image your dropped in.
What about custom made buttons with images, how should i do with those?
[myButton setImage:[UIImage imageNamed:#"myFileName"]];
As shown in the above code you should always use the non-retina fle name when you reference the image a UI element should use. That was if iOS detects the device is retina it can automatically use the #2x version in its place.
What is the normal process to manage the different screen sizes, do people add images for all displays or using this type of process?
Yes, including multiple image resolutions common practice and is required for iPhone apps (not sure about iPad) to include both retina and non-retina images. But regardless of the requirements, you should definitely support both device resolutions to keep your customers happy!

Small icon app list view osx

In some applications like Sparrow Mail are set two different application icons. The default icon used in dock, in icon view e cover flow. Then a second smaller for list view, column view and title bar. How do you set the icon smaller? In file.plist there is only this.
Thanks.
Xcode includes the Icon Composer.app application which allows you to create .icns (Icon Suite) files which support multiple resolutions like shown in the following image:
As you can see in the image above, the Get Info panel’s “proxy” icon (in the titlebar) is using the small 16 x 16 icon, while the lower icon is using one of the larger sizes. If you are used to the single-size-only ways of UIImage, how an NSImage works in OS X may be confusing at first. In iOS, a UIImage represents a single bitmap image, and is basically a wrapper around a CoreGraphics CGImageRef. An NSImage in OS X works at a higher level, and as such, is quite different than a UIImage. An NSImage contains one or more specifically-sized NSImageReps, which are more analogous to a UIImage. In the screenshot you provided, both the window title bar button’s image and the NSImageView’s image are set to the same instance of an NSImage. When that image is asked to draw itself, however, the image is choosing 2 different NSImageReps based on the size requested. For more information on how this works, see Cocoa Drawing Guide: Image Basics - How an Image Representation is Chosen.
If you’re using the all-in-one Xcode.app app bundle, launch Xcode and choose Xcode > Open Developer Tool > Icon Composer. If you’re using the older style of the Xcode tools, with multiple folders, it’ll be at <Developer Tools>/Applications/Utilities/Icon Composer.app.

setBackgroundImage forBarMetrics image size?

I am fairly new in iOS programming and I am creating my first app.
I have been trying to use the following code to change the navigation bar background image (this is using the new iOS 5 method):
[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:#"gradientBackgroundPlain.png"] forBarMetrics: UIBarMetricsDefault];
It works fine, but my image is 640 x 88 and it looks too big for the bar. It's like the system doesn't want to scale it, or do I need to do it manually? If I scale the image and create a smaller one it looks pixelated in the retina display.
Any thoughts on this?
Any help or response will be appreciated.
Thanks,
Jorge.-
Your image gradientBackgroundPlain.png should be 320x44, and create a second image named gradientBackgroundPlain#2x.png with a size of 640x88. Include the #2x image in your bundle, but continue to specify gradientBackgroundPlain.png for the name of the image. The platform automatically chooses the correct size image for use depending on whether there is a retina display present or not.