I'm trying to remove the seemingly forced left and right padding on a storyboard, need to anchor my view on the border on the Storyboard. Doesn't seem to give me the option to anchor on the border in the interface builder.
Most probably not best practice, but the design looks weird with this padding.
How can I remove the white space on the left and right:
Update:
I have checked the constraint value, its bound at zero on superview.
It only works if I use -20 and 20 for trailing and leading. Need to change superview itself?
When your on the storyboard select the control you want to have edge to edge, and in the properties window if you select layout you will see the constraints that you've added.
You would want to double click on the 'leading margin space'and set it's 'constant' value to 0 (this can be a bit buggy sometimes, so it may show 0 already, simply remove the 0, re-enter the value 0 and save)
Finally repeat the first step and select the 'Trailing Space' constraint and do the same thing.
once done press on the square icon which visually adjusts the control into it's new constraints and it should be edge to edge.
If you are in Xamarin using Visual Studio I finally discover how to tackle this annoying problem.
Click on the widget or view in the storyboard. In the properties window->layout you can see the constraints. Click on the constraint.
Before I was using -20 for constraints:
Now I fixed by having a constant of 0 and changing the constraint configuration:
Just remove the selection on the "Relative to Margin" checkbox.
Open your Storyboard using Xcode and remove the existing Leading and Trailing constraints and add it freshly by Unchecking the Constrain to margin checkbox while adding Constraints.
Related
Hi I was looking into how I could remove an offset area that is found in the default MFC Tab Control Ex. I have tried using Deflate to the rectangle that holds the Tab, but the issue was the control seemed to in the old location which no coincides with the next Tab,
I was able to move the rectangle towards left but the control area of the moved tab is still in its old place, and it seems like only the change happened visually.
I have a problem with android studio. I just downloaded and when I try to add something the app for example a button or text I get the following error:
This view is not constrained. It only has designtime positions, so it will jump to (0,0) at runtime unless you add the constraints The layout editor allows you to place widgets anywhere on the canvas, and it records the current position with designtime attributes (such as layout_editor_absoluteX). These attributes are not applied at runtime, so if you push your layout on a device, the widgets may appear in a different location than shown in the editor. To fix this, make sure a widget has both horizontal and vertical constraints by dragging from the edge connections.
Well I haven't actually done anything... Download it and instantly error...
After research I found that in the Layouts tab there is an option called ConstraintLayout. I double clicked on it and then I added the button and a warning appeared named hardcoded text and it says:
Hardcoded string "TextView", should use #string resource Hardcoding text attributes directly in layout files is bad for several reasons: * When creating configuration variations (for example for landscape or portrait)you have to repeat the actual text (and keep it up to date when making changes) * The application cannot be translated to other languages by just adding new translations for existing string resources. There are quickfixes to automatically extract this hardcoded string into a resource lookup.
There is a suggested fix but it wont change anything...
Anyone know what to do or it is just my luck...…………...
Just go to Design Tab and on Layout right-click on the layout you've and select Constraint layout --> Infer Constraints.
If you don't find this tab Infer Constraints then you've another android version so just go to Design Tab and click on the button you added you'll find a toolbar appeared you'll find in it an icon for a Magic Stick just hover on it you will find it's Infer Constraints click on it.
Im using xamarin designer with autolayout and cannot align the UITabBar to the left & right edges of the root. There is always a small margin how to remove it?
If you are in Xamarin using Visual Studio I finally discover how to tackle this annoying problem.
Click on the widget or view in the storyboard. In the properties window->layout you can see the constraints. Click on the constraint.
Before I was using -20 for constraints:
Now I fixed by having a constant of 0 and changing the constraint configuration:
Just remove the selection on the "Relative to Margin" checkbox.
Set the constant to -20 on the Trailing Margin Space and Leading Space layout elements to the Superview. I have no idea whether this is the preferred way to do this but it worked for me on my Table View.
Xcode has an option not use margins when a constraint is added.
In the iOS designer in Visual Studio, there doesn't seem to be an option when a constraint is being created.
Xcode & Visual Studio constraint margins
A work around is to create the constraint and then edit it after it has been created.
On another note, you might review why you're not using a UITabBarController which would place the Tab Bar correctly for you.
You need to uncheck the Constraint to Margin option when giving constraints for left and right using auto layout
Link1
Link2
Auto Layout guide
I have a cell (call it A) which is used once in a hierarchically higher cell (call it P). When I place A in P, its borders are rather larger than the actual content of A. When I descend to A and zoom-fit, it is way zoomed out, indicating there is something present way out on the edges.
I may have dragged objects there at one point but currently there is nothing visible. It is driving me crazy in terms of aligning objects, etc.
Is there any way to clean this up or something?
If I recall Cadence used to have a problem with leaving steiners behind when you moved routes. They are not visible but the db treats them as real objects for the bbox calculation. According to Cadence, deleting the objects should not harm anything. Open the layout in edit mode and paste this code into the CIW. This will delete all the steiner objects in your layout. If this was the root cause after saving you should see the bbox return to normal.
cv=geGetEditCellView()
foreach( item cv~>steiners
dbDeleteObject( item )
)
This thread may be considered "dead," but hopefully this helps.
It is possible the layers that are not visible are turned off.
To turn them on, go to the layers pane on the left. (If it is not there you can turn it on by going to Window —> Assistants —> Layers)
You can then click the drop down arrow in the top right corner and click Edit Valid Layers.
Then, click all valid in the Set Valid Layers popup. Click Ok.
Finally, check the Used Layers Only checkbox in the Layers pane. Look for any layers that weren't there before that you don't need.
Usually it happens when you draw the cell in LayoutXL, particularly when you insert pins.
Layer and purpose in these pins are selected separately for some reason, that is why it is easy to enter "impossible" combination.
Nothing happens, then you do it again and continue drawing. But there are several invisible squares that will continuously frustrate your inner perfectionist. You do the following:
Open this cell's layout, switch to Virtuoso window and enter:
lppList=list()
then:
foreach(shape hiGetCurrentWindow()~>cellView~>shapes if( (member(shape~>lpp lppList)==nil) then lppList=cons(shape~>lpp lppList)))
You have created the list with all layers in this layout, you can view it by entering:
lppList
You'll get something like this:
(("NW" "drawing")
("NP" "drawing")
("weird" "guy")
("M1" "pin")
("M3" "pin")
)
If you find a weird guy in this company, just enter the following command:
foreach(shape hiGetCurrentWindow()~>cellView~>shapes if((shape~>lpp == list("weird" "guy")) shape~>lpp = list("prBoundary" "drawing")))
If you see that some squares, labels (or whatever unseen before) appears as prBoundary, just delete it, save, and your layout will be small and shiny again.
I was moving stuff around to get it to work in iOS 7, then the machine crashed (not unusual with a new Xcode installation). Now the subviews don't have their positioning constraints any more. Is there a way to get them back? Don't care if it's just the default constraints, right now elements are all over the place. If not, is there a way to get everything into auto layout? Some elements appear to be spring and strut aligned, others are auto layout. Probably the crash messed it up.
At the bottom of the main edit window is a toolbar with something that looks like a tie fighter.
┣●┫
Click that, then in the menu, select "Reset to Suggested Constraints".