Why my Main Storyboard appears like shown at Above? I made a copy of the project but now both of them have the same problem with the storyboard! I can run the app using the simulator and it works fine, but I can't see any labels or the buttons.
The problem is with your device layout....
Actually it makes on other layout like wAny hAny and now you show it on other layouts like wCompact hRegular....thats why the problem occurs...
Here is the visual site of it....
To prevent this type of things...you need to give constraints to your objects..after making correct constraints, the size classes won't matter that much except adaptive layout
Its because of Auto Layout Stuff. Set proper auto layout to you label object.
For eg.
Set Leading,Trailing,Top & Bottom layout to your label & then run your application. You will be able to see it on your screen.
I'm new and following a tutorial when I misclicked on the "Show the Version Editor" button instead of the Assistant Editor all my graphics I've made in the Main Storyboard is now blank! I can find them in the tree but they are "grey" or "faded", so I can't drag and drop anymore.
I guess it's just a view setting or something but I can't find how to restore it to normal?
Please help, looks like I can't post a screenshot of it since I'm new :(
Thanks
NisseB!
I fixed it myself! I just had to change the canvas size to what I had before running the Version Editor (for all iPhones) and then all the objects appeared again! If I also disabled Auto Layout I got some objects back, but in wrong locations, so this was better!
I'm trying to have custom constraints for objects in my storyboard but I get a bunch of warnings that say
Misplaced View Frame for "Some object" will be different at run time.
or
Ambiguous Layout: Width and horizontal position are ambiguous for "Some object"
The problems is that if I let Xcode resolve them it will mess up the custom constraints I've set up. The recommended constrains make the layout look bizarre. So how can I suppress these warnings because I'm trying to do something very customized?
Ok guys I've solved the problem. I was pretty new to autolayout so it was very frustrating trying to learn it by trial and error.
I solved it by reading this awesome autolayout Xcode 5 tutorial and adding the necessary constraints.
If anyone else is having problems with constraints I can't reccomend the tutorial enough.
If you'd like to disable storyboard warnings altogether, go to your project build settings and set "Interface Builder Storyboard Compiler - Options" -> "Show Warnings" to "No."
I am pretty new to iOS development and I was poking around in storyboard in Xcode 4.5.2. I started a new tab bar project (5 tabs) and then dropped in some images (UIImageViews objects) to them, everything looked good and the build came out fine on the simulator but not all the images are showing up. The same image would be showing on the Firstviewcontroller but it won't show on another viewcontroller. And I can't seem to add new image objects into the firstone (meaning i can place it in the storyboard but new ones won't show up on the simulator), It almost seems to be showing cached screens. For example, I just randomly place images all over a viewcontroller and then shifted them around and ran the simulator again but the positions do not match.
Does anyone have any information or experience with this on Storyboard?
Thanks in advance.
Ray
In my case when I have created new project in Xcode 6 I can not show the images in the Simulator and as well as in device. I have imported all the images in the image assets making a folder within that.Now I have imported all the images, all are working fine now. All images are now showing now.
Follow these steps:
STEP 1:
STEP 2:
STEP 3:
and then Import images which you need. Reference Link:
StackOverflow link
I had a similar issue. But later found out that this was because I had put the images in a real folder in the app directory. So there was my project's folder, which contained another folder named 'Assets' which contained the images. This was solved when I moved my images out of the folder and put them in the project's root folder.
In my case the picture was a JPG and not a PNG.
Replacing image in xcasset for the same image converted to PNG was the trick.
Restarting simulator fixed my problem. I think it was a cache problem.
NOTE: I'm using iOS 10 with xcode 8
I encountered this problem after I refactored storyboard.
The possible solution:
- Go to Storyboard and select the image you don't see in the simulator.
- Go to the Attributes inspector and re-select the image again.
After Storyboard refactor, sometimes Xcode assigns Unknown image to the UIImageView.
Reselecting the image solved the problem.
It happens when you change the folder for your storyboard or image. (Possibly copied storyboard from another project).
Find your Image in the Project Navigator, Select it and change it's location to (Relative to Project)
If necessary, you'd need to relink your image.
#PressRay, I have been toying around with things and have some suggestions. I have moved this to an answer, because they would have put us in chat if we kept going. But hopefully this will do it. First off, I think you should make your tab bar from interface builder, perhaps you have input some code incorrectly. You can either start one from the first screen of create a new project, or you can drag one in from the library. But it is a Tab Bar controller. Then for each of your five views, you can place a view controller on the screen for it. Then you can drag from your tab bar controller to each of the five new view controllers and select relationship tab bar controller. This will set up each vc for you.
Next I would suggest you turn off auto layout to get a feel for story boards first before you jump into auto layout and constraints. That is why I think your png's are not showing up. The two lines look like they are too close together because of some contraint moving them. To do this select the view controller, make sure it is just the view controller and then in the right hand view, go to the file inspector, it looks like a page icon. Under Interface Builder Document should be a check box for Use Autolayout. Click this so there is no check mark. Now you will be using struts and spring on each vc that you turn this off. So go ahead and turn it off on all of them.
Next you have some png files to put in. Drag your image views to wherever you want them in any of your vc's. Then hook up the png files by selecting the image view and then once again on the right hand view select the attributes inspector and under the drop down menu of Image find the png that you want. Then you can move the image views anywhere in the vc that you want. I think this will solve your problem. Let me know what happens or if you have any questions.
For xcode beta (swift 4) converted the jpg to a png file, and created a folder called images.xcassets, added the png file to the folder. It worked going to try adding the jpeg to the folder and see if the image shows up. I just tried the jpeg and its not showing up. So my conclusion is to use png files and create a folder to hold the png files. Add the folder right after the Main.storyboard. Hope this helps.
I just changed the image/file names. Sometimes if there is a continuous pattern xcode gets stumped. So if you have image_1, image_2....change to 3_image. This fixed my problem.
try to check the image properties in your project in case you haven't set them
to
https://web.archive.org/web/20110604185120/http://developer.apple.com/library/ios/documentation/iphone/conceptual/iPhone101/Articles/05_ConfiguringView.html
To add an action for the button . . .
In Xcode, select the view controller’s nib file (MyViewController.xib).
Display the Assistant editor.
Make sure Assistant displays the view controller’s header file (MyViewController.h).
Control drag from the button in the nib file to the method declaration area in the header file.
How to do step 2?
How to display "the" Assistant Editor?
It's exclusive to Xcode 4:
In Xcode 6
It is the second button with two circles.
EDIT: As of the latest version of Xcode this has changed.
In XCode 6.2 it seems they've changed the icons again. I was having trouble finding it but I didn't realize where the buttons were until the dumb old me trying to pick up iOS thought I was missing a view, so here I am posting this for any passerby who needs some visual confirmation.
To be fair, I was looking for something based of some instructions I had read that referenced the two circles, and it didn't occur to me that two circles meant a split view / assistant editor, and not until after finding this post and figuring it out did I realize a suit was a reference to a butler AKA assistant :D