I converted an iphone xib to ipad via this helpful approach but now all of my views are tightly packed in together in interface builder (screenshot: IB views squished together).
I cannot drag and drop them to spread them out. The UI is unresponsive to dragging. Appreciate suggestions... wondering if there is some additional change to the XIB XML for the conversion from iphone, or if there's an IB setting to allow dragging the views.
Thanks to Popeye's response, I got the idea to try a mouse directly connected to the Mac, since I have been using ShareMouse to remotely mouse from a PC (Windows 7). This solved it.
Appears to be a bug in ShareMouse or an interaction bug between ShareMouse and IB. I could select any of the views, but drag did not work. (Dragging works just fine with ShareMouse on other things in and outside of xcode.) I will drop a note to the ShareMouse guys.
Related
I often make use of views in interface builder that live outside of the viewcontroller hierarchy (see screen grab below for simple example).
Before upgrading to Xcode5 I could get this view to appear on the storyboard by writing an IBAction outlet and dragging a connection from the code to the view in the storyboard.
If you paused over the button for a moment it would flash and then open up as a view on the storyboard that is then a lot easier to work with.
Since upgrading this function no longer seems available. Has anyone found out how to get these views to appear on the storyboard?
Edit:
Using the temporary viewcontroller as described in this answer seems one approach, although fiddly since you need to move the UIView stack between viewcontrollers each time you want to edit the layout. Using a separate XIB is starting to seem like the sanest approach.
https://stackoverflow.com/a/13713385/1060154
Finally, we get this back in Xcode 7.
Hallelu!
I'm running xcode 4.5.2 to write an iOS app for both iphone & ipad ("universal" app).
I'm able to use the iphone storyboard to drag & drop buttons, labels, etc onto it. In fact I have functioning code on the iphone side.
However, since the beginning, I have not been able to drag & drop anything onto the ipad storyboard. When I try to do so the buttons, labels, etc just "bounce off".
Is there a way to reset the iPad storyboard so that I can get a clean start? It potentially could be that I had mistakenly (this is my very first iOS app) dragged a view or view controller onto the ipad story board. I tried deleting it but the whole ipad storyboard disappears after that.
It is probably something very simple but I'm very new to this. Thanks.
You can only drag & drop items into a view if you are in the most "zoomed-in" way of viewing it. Try pressing the "=" in the bottom right corner when you bring up your iPad storyboard (this will toggle between the most zoomed-in and the most previous zoom out). Once it zooms you in all the way, try dropping something onto your view again.
EDIT: Per Xcode 8 Release Notes, Interface Builder should now allow editing at all zoom levels.
I have a problem with accessory views on NSSavePanel and NSOpenPanel.
Sometimes, (very often) when I open one of these panels the accessory view does not work (the view is shown but controls seem disabled).
I'm using this code to show the panel:
[openPanel beginSheetModalForWindow:appWindow completionHandler:openPanelHandler];
This only happens when app-sandbox is enabled.
After much testing I found out that what was happening was that the view was being misplaced (not attached to the panel).
When I open Mission Control and move the mouse pointer over the app windows I noticed that an "invisible" window hilighted and when select it I can take control over the accessory view (all controls work) but it appears detached from the open or save panel as shown on the screenshot.
I tried to create a new app just to test this behavior but was not able to reproduce it, so I suppose that has something to do with my app.
Any hint of what I may be doing wrong?
I don't want to code everything from scratch just to solve this issue.
Edit
Just a side note, when I close the window, just before the window close the accessory view flashes with the correct values for the controls. It appears that the application does not add the view in time for showing the panel.
Update 1
I subclassed the view that is used as accessory view and noticed that the
- (void)viewWillMoveToSuperview:(NSView *)newSuperview
is called, but
- (void)viewDidMoveToSuperview
never gets called even when the view is shown correctly, is this the normal behavior?
Update 2
I confirmed that - (void)viewDidMoveToSuperview should be called, on the test app both methods are called.
I also noticed a slight difference between my app and the test app. On my app the panel just slides down but on the test app the panel appears to "flip down" (don't know exactly how describe). The way the panel appears is irrelevant to me, I just noticed that it is not shown the same way.
After trying many things I concluded that the problem had to do with ARC (Automatic Reference Count) settings for the project.
In my case I had enabled ARC on target but not on project, after enabling ARC on project (and dealing with resulting errors and warnings) everything works perfectly now.
I have two NSTextFields in a xib file I'm using to display some preferences to users.
There is a save button that I wanted to be unusable until these preferences have been filled out. For some reason, this made all the NSTextFields in the xib file totally unusable as well (it was as if they had been disabled).
When I enable the NSButton, everything works--but with a catch. Whenever I focus the cursor or type in one of the NSTextFields, the text inside flickers. It's really disconcerting.
There's no custom code powering the UI elements.
Any help is greatly appreciated.
It appears as though this is a bug in Interface Builder.
After deleting the NSTextFields that were flickering and adding them back in IB, the flickering stopped.
I'm building a xib with multiple views, one oriented for landscape and another for portrait. I'd like to be able to zoom out from the Interface Builder window to see both and then zoom in on one of the views to work on it, rinse, repeat. Can this be done?
This is not possible as far as I know, but Xcode 4.2 allows you to develop your iOS applications using "storyboards", which is similar (and has many other benefits).