Comments (4)
@sdyalor your example forces the entire width because you are using pipes on both sides which creates a constraint with default margins to the edges. With |-a-10-b-|
view a is given a left constraint to it's container's left + default margin. view b is given a left constraint to be view a's right + 10 AND a right constraint to be it's container's right - default margin. If you removed the pipes and just did a-10-b
then they will not span the whole width. They would likely be left aligned because autolayout has no other instructions of how to lay them out.
if you wanted them centered with 10 pixels between them it's easier to to use the dot notation and do:
a.Right == parent.Center - 5
b.Left == parent.Center + 5
where parent might be an implied "self" depending on the complexity of your layout.
from stevia.
@sdyalor can you provide a image/ visual representation of want you want please ?
from stevia.
Now:
imageView.Trailing == titleLabel.Leading + 12
imageView.Trailing + 12 == titleLabel.Leading
and
imageView.Trailing == titleLabel.Leading - 12
imageView.Trailing - 12 == titleLabel.Leading
It's a little bit strange. I wait that it would be like imageView.Trailing == 12 + titleLabel.Leading
or imageView.Trailing + 12 == titleLabel.Leading
to work as i need, but it don't. I think it should be in wiki.
from stevia.
@NikKovIos when you go right direction, x coordinates increases. If you go left side x coordinates decreases.
In this picture, label's leading edge should be greater than red views's trailing edge. Why?
The reason is label is on right side according to red view.
from stevia.
Related Issues (20)
- Example for UIScrollView HOT 1
- Can't add the Stevia from swift package manager HOT 2
- Set left, right edges space to more than safe area HOT 2
- Additional operators for LayoutAnchors? HOT 2
- Working with Safe Area Layout Guide and Operators HOT 5
- Swift Package Manager dependency resolution fails HOT 3
- UICollectionViewCell & UITableViewCell iOS 13. Add subviews in contentView.
- Value of type 'Button' has no member 'style'
- SteviaLayoutX/YAxisAnchor doesn't support inequality operators? HOT 1
- LastBaseline crash
- @_functionBuilder
- Version compatibility issue in 5.1.1 with swift 5.5 Xcode 13.1 HOT 4
- Height equal height with multiplier. HOT 1
- using layout with safeAreaLayoutGuide
- SwiftUI preview fails with error: could not find module 'Stevia' for target 'x86_64-apple-ios-simulator'; found: arm64-apple-ios-simulator
- Support for cornerRadius
- Multiplier in Constraints
- Different behaviour with same constraint
- [Privacy Manifest] Implementation HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stevia.