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 am a complete newbie in Mac development. I want to achieve the following functionality :-
I have a view with a two textfields and a login button.When the user clicks on login button another view should open.
Now my main view is in MainWindow.xib file..
I added another view using
Add-> New File-> Xamarin.Mac-> Cocoa View with controller, which generated the following files:-
1.) NewView.cs
2.) NewView.xib
3.) NewViewController.cs
After searching quite a lot on net i did not get the exact way to achieve this functionality. I referred this thread
Easy Switching of "View Controllers" in Mac Apps (similar to iOS)
but could not get the much out of it. Can someone tell me how to simply navigate from one view controller to another using Xamarin.Mac and where what code is to be written??
Any links,code snippet or sample code will be of great help!!
Thanks a ton in advance!
Here is the answer :-
If you want to switch from one view to another below code snippet shows how to add and remove views:-
Write the below two lines in your Action of login button.
Previous view will be removed and new view i.e SecondView will be added.
this.View.Superview.AddSubview(new SecondViewController().View);
this.View.RemoveFromSuperview();
Cheers!!
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
This occasionally happens when I'm editing xib files. On certain occasions simply clicking the associated view controller file and then clicking back on the xib file has resulted in the menu options being re-enabled. Not today however.
This behaviour/defect has been funky since the days of XCode 3, and yet I still can't google anybody who's posted a question about this or received an answer.
Thanks!
Try clicking on a control (not a view), and see if the menu items are enabled.
As #amergin said, you have to select the view on the canvas, and not in the sidebar.
I'm trying to find a tutorial or book, that explain who to make a menu application, like the iPod/iPad menu, with images as buttons, and pages. What i'm trying to do, is a menu, with a Popover window, when an option from the popover is selected, then the menu is filled (with code) with the buttons/images, that can be located in more then a page.
Thanks you in advance
Okay there are two things you can use here:
The Three20 library , which has several extra components you can use as well: repository here
If you want just a view similar to that and nothing else, you can go with myLauncher: repository here
I know there are probably more, but these were the main two I looked at when I went looking for a similar view.