I noticed that Xcode 7.x interface builder add buttons on the UINavigationBar that are slightly bigger than those used by the standard apps, like the mail app. The add button (+) and back (<) are smaller in the standard apps. I want to keep the standard buttons, but I want them with the same size of the other applications. Do anyone know how to achieve that? Thank you.
Simply modify the size of the images in your assets catalog. Remember to customize each image based on the associated screen resolution.
In the image above, the 1x is what you would see on a smaller/lower resolution device, while 3x is what you would see on a larger/higher resolution product.
Related
I want trying to place two different UIImageView at different position in my iOS project using Storyboard. In one resolution, I can able to set this properly but if I check into other resolution then its not looking properly.
Definitely I am new in iOS application development so making small mistakes.
I have actually make my layout and graphics in iPhone8 Plus resolution and here is what I have designed page in Storyboard.
Its looking proper as per my design layout but as I switched my layout say in iPhone5s then I got horrible result.
Please check below image:
As per my best understanding, I have set few constraints too. That you can see in both images. At present I just want to worries about header and footer logo UIImageView's scaling and positioning. If these two Views get solved then I will manage other Views too.
EDIT:
Here you have Footer Constraints:
#1x,#2x and #3x image resources already exist in project but as per my thinking its not get detected.
In terms of creating UI screen, I have followed reverse path. Actually I have designed graphics in 1080x1920 resolution so its my #3x and then I have cutting down size of each object respectively for #2x and #1x resources.
Please give me some help into this.
set the size of image in 1x and add the image in 3x format, for example your image name is xyz.png then it will saved as xyz#3x.png and xcode will automatically use this image on your app. you just have to calculate the size of the image in 1x set it to the view and everything will work.
Please check this and let me know in case it doesn't work.
You only need to set the constraints for your logo UIImageView's like this:
For logo_main:
top=20 (your value), bottom=20, leading=20, and trailing=20
For MainFooterLogo:
top=0, bottom=0, leading=8, and trailing=8
and set UIImageView's Content Mode to Aspect Fit:
Your problem will be solved but you need more constraint and may be a UIScrollView for your middle container view.
I'm trying to create an new asset catalog for universal project (iPhone and iPad). I add new xcassest:
But As you can see in case of iPhone only shows one option for 2x. In my case I need to add backgrounds and for both 4-4s and 5-5s phones the images are 2x also is not showing an option for the 6/7 and is also 2x.
My question to guys is how can add the assets for every screen size in my xcassest file.
I'll really appreciate your help.
Nothing is "missing". Screens can come in different resolutions, and all possibilities appear in the screen shot. So every image in your app will come in three versions, and slots are provided for all of them. (You should use "Universal" unless the images for iPhone and iPad are truly different from one another, i.e. different content.)
As for image size, just use a size that works with the largest screen and permit the image view to scale it down as needed (or, for less memory waste, scale it down in code yourself at runtime).
I'm coding a remote control with a background (designed in Photoshop) already for the iPhone 6+ with the proper resolution, which I use with an UIImageView at full size.
I disabled Autolayout/Size Classes and set the size to Inferred. Further I uploaded all relevant LaunchImages for proper scaling.
The UIImageView scales properly for all screen sizes, but the buttons I put over the background are moving.
For example:
All buttons (over 1-9, Power Off, Menu ecc.) should always stay at the same position (in releation to the selected device and screen resolution).
I can't get it, that all buttons stay over the designed photoshop elements.
Please give me a good advice, to solve this issue.
I would recommend using size classes and Autolayout. This type of thing is exactly what they are made for.
This youtube video is a great introduction to size classes and some Autolayout:
https://www.youtube.com/watch?v=IwSTXY0awng&feature=youtu.be
I have a graphic designer that creates images and things like that for me. Do I need give him separate image sizes to be created specifically for iPhone 5, or do I build like I used to for the 3.5 inch screen? Will the images be resized automatically?
Here is one link that may help you.
Naming convention for iPhone 5 images?
and heres another
Screen size of iphone 5
Reviewing these links basically evaluates to yes you have to create separate images for iPhone 5 you will need to add -568h#2x.png to the end of each image that is for iPhone 5. You need to also create and set the launch image as well called Default-568h#2x.png are it will not pick anything up for the iPhone 5.
No it will not resize the images automatically it will select the correct image to use, it will select the one with the -568h#2x.png simple as that.
Hope this helps.
You have to provide specific files if your images are dependent on the screen ratio.
In order to conditionally use an image according to the device you can use the technique shown here.
If that's not the case, simply provide the same images and adjust the layout programmatically or within Interface Builder.
No iOS devices with a retina display can run iOS 3. You will need high resolution versions of all your pictures.
As for converting photos to work with the iPhone 5, it depends on the photo and how it's used. If the image is used as part of the background, you have two options: you can tile it, which would not require new pictures, or you will have to redesign it altogether.
As for the other pictures, whether you can work with the same ones (same size or resized) or need new ones depends on user interface decisions only you can make. If an image must retain a certain ratio, then perhaps you can resize it and place it accordingly, or maybe an entire new image would work better.
1. What is the best way to insert a background in a xcode ios app?
2. I have two backgrounds, one big that covers it all and one smaller with some details on the bottom. Do i have to make two different pictures for the smaller background so that it fits on all iphones?
-Simon
The background picture should be on the main view and for inserting the smaller picture, use a subview. You can also popup a subview or animate it if u want to.
I think in general the best approach is to create two images that have the same content but are different in size.
You should create one image that is 320X480 for the iPhone 4 and below and one image that is 640X960 for the retina display on iPhone 4S and above. the format is:
ImageName.png (320X480)
ImageName#x2.png (640X960)
When you're referring to an image in your code you should use ImageName.png as the source image and the device will automatically decide whether to use the regular image or the retina display image.
It will be very user friendly (to say the least) to use the same content in your background whether it's an iPhone 4 and below or above.
As a side note: if you are using Cocos2d the HD image format changes to ImageName-hd.png