Xcode Interfacebuilder bug? - ios

I got a problem in the Xcode project.
below image shown UITabbar problem. I thought it's a Interface builder bugs.
UITabbar showing a dark color. That only shown a root & one-depth ViewController.
How can I solve it?
Thanks.
== Modified ==
The problem suddenly appeared.
It is not known whether the problem is caused what.
TabbarItem area is like a shown bug as image.
I hope Tabbar area to be displayed correctly.
I tried to various way to solve the problem.
tried ways as a below :
regenerate xcode project and then copy storyboard. => fail
regenerate storyboard and then copy partial elements in storyboard. => fail
regenerate all of them. => I did not try yet.(have too much elements. I want to avoid like this way.)
Interest point is sometimes display correctly. When I first open a simple storyboard file(Default UITabbar Project's main storyboard) like a below image.
it bring to me confused.

I'll summarize what I know about storyboard that may cause similar issue...
Assigning images that have incompatible width:height ratios to tab
bar items
Not assigning any images or not using any system images for tab bar
items
Hope this can help anyone else that has similar issues...

Related

Constraints not working in TableViewCell

I'm learning how to use CoreData to store images, and I'm making a blog reader. I have a view That shows all the info saved as a list and when you click it takes you to that article. My problem is that I can't make TableViewCells look as intended. I have added the constraints and not a single of them is being placed.
Here are my constraints:
And this is the result:
I've deleted them, cleaned, closed xCode, put them again and the same result. Found this answer, checked and nothing. Also this one. In the same project, I have another TableView and it works fine, any ideas why this is happening? Thanks a lot!
Looks like image is overflowing form the container. Try this
Set the UIImageView content mode to UIViewContentModeScaleAspectFill
Set UIImageView clipToBounds to true.
It seems like issue not because of constraints. it because of image to solution for this issue
You have two option to solve this
1) Via code
cell.YOUR_IMAGE_VIEW.clipsToBounds = true
2) Via Interface Builder
Hope this will help you

How to properly show a popover?

So I've linked one button (the one which represent a trash, in blue) with a second scene on my project as shown in the following link: https://gyazo.com/52f140f12cd5d80dd7e4ea191e8daa5f
My problem:
I don't know why, but my popover does not fully appear, see this picture:
My question:
Knowing that i'm actually working with the interface builder, how can i manage this popover so it will be fully displayed (it actual size are normally set as 500*500)?
Or do I have to do it programmatically? If yes, can someone give me a hint?
Thanks in advance!

Navigation Bar Item Image is not visible

I trying to implement a hamburger menu using a scroll view, two container views and two embedded views with Swift 2 and Xcode 7. Everything works but for some reason, I can't see the picture of the Navigation Item I set. However if I click on the area where the Item is supposed to be it responds as I expect. But I can't figure out why I can see the Nav bar item image?
Any idea what I am doing wrong?
Thanks
Be sure that the image that you're trying to set is added to your project. Not the project folder but the actual Xcode project and used in the target that you're currently using.
My guess is that you're setting the image with
UIImage(named:"YourImageName")
Also, another hint is that you can make your button visible.
Hope this helps.
I figured out my bug. I had copy a piece of code to create the menu image and paste it in a class with the same name. So the image was never created. But Xcode didn't complained that I have a nested class of the same name as the main class, that would have helped so much :-/

Setting Modal Presentation Style causing views to disappear (Xcode 6)

I have set up my view in interface builder. I am using auto layout which has been set up also.
If I present my view with the following code:
GlossaryViewController *glossaryViewController = [[GlossaryViewController alloc] initWithNibName:#"GlossaryViewController" bundle:nil];
glossaryViewController.delegate = self;
glossaryViewController.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentViewController:glossaryViewController animated:YES completion:nil];
Then everything works fine. However if I change modalPresentationStyle to a smaller style such as UIModalPresentationFormSheet then none of my views are visible when the view appears.
I have even tried testing it with just a UIImageView that is set to hug the four edges. Even this disappears.
Before I upgrade to Xcode 6 I had created similar views that still work fine. This has only occurred when creating a new xib.
Has anyone else had similar issues?
After deleting the app, deleting the troublesome nib, doing a clean, restarting xcode and then recreating the xib I still have not be able to get this to work. This was after attempts at changing the size of the view, orientation and playing around with auto layout.
The behaviour is rather odd. Sometimes a single view might show but adding any others by it does nothing.
I have hopefully found a work around for now. If you do as follows:
Click on files owner and then go to the 'Show file inspector' tab.
Next look for 'Interface builder document'. Under this heading is 'Opens in'. Change this from 6 to 5.1.
The following popup appears. (WARNING: if seems once you have clicked 'Disable size classes' there is no going back. So make sure it's what you want to do):
Select the option you want to keep. So if the xib is just for iPhone then select iPhone. This will then give you back the way it was in xcode 5. Basically it's converting it back to a xib that handles either iPhone or iPad and not both.
Look forward to hopefully someone being able to explain what I am doing wrong or if there is some sort of issue with interface builder at this moment in time. Be good use the new interface builder instead of switching back to xcode 5.1 xib interface.

Why are two different UIToolbars, defaulting to different styles?

Consider the following two toolbars that are in the same project of mine:
Notice that these toolbars look different? The problem is that they were both created by dragging and dropping them into IB, and I didn't change any of there associated properties. All that I did change was adding the flex controller, and change the text on the initial UIButtonBarItem. Other than that, these Toolbars have not been modified and, furthermore, I've verified that their properties are exactly the same in the Attribute inspector.
How or why are they different? Furthermore, how can I get the first, bluish UIToolbar to look like the grey one since the available Black Opaque and Black Translucent styles look nothing like the grey one?
Am I missing something? This doesn't make any since.
I've found why this is happening but I'm a bit clueless on how to change this. See this, new question regarding a fix for this issue.
These Toolbars are changed due to internal Xib settings that are specified when the Xib is created. In the first example, when I created the UIViewController I must have unchecked the Target for iPad check box, even this is for an iPad project.
This changed the default size of the initial UIView that was in the Nib. I always cut off the statusbar and set the view to be freeform in sizing as soon as I create a UIView within a Xib file, so I can never tell by looking at my views whether they were targeted for the iPad or not.
When I created the second UIViewController object, I checked the Targeted for iPad option. Now, my toolbar is styled with a grey tone.
The lesson learned is obvious-- if you want consistency in the default style of your objects that you pull from the IB Toolbox, be sure to create your UIViewControllers, specifically targeted for the iOS device. If you've made the same mistake that I have, follow the linked question above for how to revert your UIViewController and Xib file to the other style of View Controller.

Resources