How to delete Constraints from Main.storyboard with Xcode 8 beta? - autolayout

I try with backspace how it was on swift 2 but in Xcode 8 beta I can't do it the same way.

Double click the constraint in the Right Pane (Size Inspector). This will then show the constraint in the left pane. You can delete the constraint from the left pane by using backspace.

Related

Two UITableViewCell have same constraint but appear different in Interface Builder

I'm designing a prototype cell in Interface Builder. Another programmer built the previous cells in Storyboard before me, I'm just adding the new one in image 2 with the [Some text] label. Both cells have the same class set in interface builder, a custom UITableViewCell subclass.
Existing cell: has leading space to superview = 10, but somehow the constraint is pinned to some floating point in space (there is no parent view other than Content View).
My cell: has leading space to superview = 20, but it pins the edge to the actual content view superview. If I set it to 10, they will look way different, but on paper have the exact same layout constraint (leading space = 10 to superview).
So it looks almost as if there is some sort of invisible edge inset, or layout margin, but I don't see any properties in interface builder that could affect it. Any ideas?
The solution turns out to that you need to use the bottom toolbar button to be able to constrain your leading edge to the superview margin (with the checkbox). I was using cmd + click and drag menu, which is why I couldn't find it. Doing this in a UITableViewCell subclass pins it to a margin.

Xcode 7 add trailing/leading/top/bottom constraints

In Xcode 6, I could use the Editor menu to Pin:
Leading Space to Superview
Trailing Space to Superview
Top Space to Superview
Bottom Space to Superview
I can't find a way to do this in Xcode 7 beta. If I press the Align button in the Storyboard view, I see:
Leading Edges
Trailing Edges
Top Edges
Bottom Edges
Which I assume is the same thing, but they are all greyed out.
Adding these 4 constraints in Xcode 6 would have taken about 20 seconds, but it took me 30 minutes to put it in Xcode 7 and can't figure it out.
Unfortunately they removed this option from the Editor Menu but there is a drop-down menu. There you can select another view to which you can assign your margins. .
To pin Top, Bottom, Leading, and Trailing to the Superview, do this:
Select the view.
Click the Pin button (looks like a TIE Fighter).
Under Add New Constraints, uncheck Constrain to margins.
Click the left, right, and top and bottom beams.
If you click Add Constraints button, it will pin top, leading, and trailing to the Superview, and bottom to the Bottom Layout Guide. If you want to pin bottom to the Superview also, press the drop down arrow next to the bottom value and choose View instead of Bottom Layout Guide. Then click Add Constraints.
Well, I also meet this problem in Xcode 7.2, and have found out a way to solve it.
In Xcode 7.2 (and perhaps also in your version of Xcode), firstly select the view that you want to add constraint to, and then press the "control" button on your keyboard and keep doing it, and then drag the view to the super-view. Then a menu will appear, and then you can select to add some constraints. After adding the constraint you can release the "control" button. Note that the direction you drag will affect the available constraints at this time. For example, if you drag left, then the trailing constraint may be unavailable.
Right next to the Align button is Pin button where you can set what you want.
When you add a constraint via Add New Constraints you have a choise:
By default Xcode uses Safe Area - Align Top To
If you select a superview - Top Space To

QT: How to control the cursor in MainWindow.ui

In Qt, I have three QTextEdit1 widgets aligned vertically in MainWindow.ui. When I run the application, the cursor always becomes active on the QTextEdit2 widget (not the first which the user must fill first). Another issue is when I press tab on the keyboard, it goes to QTextEdit3 which is ok. but when press Tab again it goes to QTextEdit5, ignoring QTextEdit4. The following explain more.
QTextEdit1
QTextEdit2 [the cursor is always on this QTextEdit]
QTextEdit3 [first tab]
QTextEdit4
QTextEdit5 [second tab]
I want the cursor to become active on the first QTextEdit and when I press tab it goes to the next one weather it is vertically or horizontally aligned. Now it seems it jumps randomly !!

javafx - add elements to border pane at runtime

Using JavaFx (and scene builder) , I have a window (border pane) which I need to add elements at runtime.
each element has 2 labels and one table view (see
The final window need to be something like:
I have search at the net, and can find any clue.
I'm build the element (in scene builder as separate fxml file) with Anchor pane, it is ok ?
How can I add X element (at run time) to the main window (as final example)
Thanks

XCode 5 - Constraints not always kept at runtime when using a Tab View Controller

In Xcode 5, I've opened a new project and added the following:
A Tab View Controller with two Tabs (thus two View Controllers).
In each Controller View, I've added a CollectionView, with both a Label and a Button under it.
I've applied the Default constraints. No warnings.
... clicked Run.
In the iOS simulator, the first Tab looks ok, all elements in the View are aligned to the bottom of the layout, which is the top of the tab bar. Perfect.
When clicking on the second Tab, instead of aligning to the bottom of the layout, it aligns everything to the bottom of the container. So all the elements in the View drop in height by that much. Clicking back to the first tab will now show this incorrect positioning as well.
Strangely, rotating the device fixes this... showing the correct alignments in both tabs and for both orientations.
Any idea what am I doing wrong?
Thanks,
I now believe this is a bug in XCode 5.
I got around it by replacing the constraint for a pin, like so:
Editor -> Pin -> Bottom Space to Superview.

Resources