UITabBarController icons not showing up - ios

I have an app that has a UITabBarController with four view controllers embedded.
I've created icons for both normal and selected states and set them via the interface builder. The sizes of the individual icons vary slightly according to the new design guidelines. Also the icons are PDFs. I initially set it's Render As property to Template Image.
The titles of the tab bar icons show up but not the icons.
But they do show up in the interface builder though.
Then I set the Render As to both Original and Default but neither worked.
I'm using Xcode 10.1. What am I missing here?

It seems problem with image you are using. try setting different insets to image and tab bar icon will appear.
i have set some inset for icon and icon appeared in simulator.so you will need proper icon image for asset or would required proper inset for icons.

Related

UITabBarController icons display incorrectly

I am building a universal iOS App. I have 5 icons on the UITabBarController and two of them are displayed incorrectly. They are higher on the UITabBarController than the rest of the icons. I can't figure out what the issue is.
First:
Select your Tab Bar Item in the storyboard.
Second:
Set the insets you want:
Sidenote: (Probably your actual problem)
Make sure your images are correct size in pixels before adding it to your project, to avoid taking up to much space and have the images sticking outside the UITabBar. All your icons should have the exact same height/width when you add them to the project.

UIButton is out of navigation bar

I have a custom UI Button (just regular button but with image), within the navigation bar, but when I choose my image it looks like this in designer:
As you can see here, it's over my provider and status labels, and also when I run application it's over the WebView (which is bellow), so definitely out of navigation bar. I tried to find in storyboard some property where I can adjust this but I couldn't find any. I'm using swift and storyboards.
Appreciate any help, iOS newbie :)
Based on your description I think your issue is that you are trying to add a button for navigation. What you need is a NavigationBar with a NavigationItem/BarButtonItem in it. If you look in the object library you will be able to find these.
Just drag them onto your story board. Once there select the button and in the side menu you will be able to select the Image for that Item. Now it is in the navigation bar up top. Let me know if there are still issues. 👱🏼
You have to make sure your 1x image is to the specified size (and then your 2x etc, or just use a PDF at the 1x size.
Icon sizes are here: iOS Human Interface Guidelines: Icon and Image Sizes
I made my pdf 22x22 and added it to .xcassets with scale factor "single vector"

How do I show Placeholder Backgrounds in Xcode Interface Builder?

How do I set and show custom Placeholder Backgrounds in Xcode 7's Interface Builder?
This functionality was added in Xcode 7, but I can't the way to set it.
Background placeholders on custom views and other containers can be hidden on the Interface Builder canvas by selecting Editor > Canvas > Show Background Placeholders. (20580948)
I've enabled in but nothing changed and I can't find where I can set a custom placeholder image:
A few years later and Xcode 10 still doesn't provide any of the flexibility you had in mind back then 😐
From Xcode 10 documentation:
Use placeholder backgrounds to identify image views, MapKit views, MetalKit views, GLKit views, and SceneKit views. Hide the placeholder backgrounds to focus on the content of your own views.
Choose Editor > Canvas > Show Placeholder Backgrounds to toggle showing placeholder backgrounds for certain types of views on the Interface Builder canvas.
The feature really is limited to only some of the built-in views from Apple (and even those that blue-ish background color is still pretty much hardcoded).

Interface Builder Scaling?

I've noticed in two different projects over the past few days that distances aren't lining up between IB and the actual app. For example, in one application I have a MKMapView. In IB, it is aligned with the bottom of a UIImageView, however when deployed on device it overlaps by about 20pts.
What's the issue? Elements are getting pushed up and down the screen. Using a tab bar interface. The tab bar is present on the bottom of the NIB, so I don't think it's a resizing issue. Help?
The tab bar should be a "simulated metric", not an actual tab bar on the screen. Select the main view itself (click the border), and open the attributes inspector (Command-Option-4). Under Simulated Metrics, select Tab Bar from the popup for Bottom bar.
The other possibility is when rotating—set your structs and springs correctly. You haven't mentioned rotation though, so I think it's the first answer.

Force UITabBarItem's image to a specific size

I have a UITabBarController, initialized by a xib file. all it's view controllers are initialized by a xib file as well.
In apple's HIG it is specified that a High-resolution tab bar icon should be approximately 60x60. I have a set of 52x52 icons, and I used them as the image for the tab items. but for some reason, it displays them as if I'm using a none-high resolution screen - they're off the bounds of the tab bar item, and are pixelized.
How can i set a "fixed" size for the icons so this will be avoided, and how can I, using Interface builder, choose different tab bar images for low-resolution and high-resolution screens?Tnx in advance!
What names are you using for these images?
What you usually have to do is have the standard image named xxxx.png and the high resolution retina display image named xxxx#2x.png
When you use these images in interface builder, use the standard image, the system will look for that filename with "#2x" if it's being executed on an iPhone 4.

Resources