Comments (8)
Any solution to this?
from stevia.
Not yet, I think this repo is not focus about vertical align problem, so I use another repo solute it when I need to custom specify constrain.
from stevia.
Do you mind sharing you fix? It will be very helpful.
from stevia.
For me what is what I do:
addConstraint(item: view2, attribute: . bottom, toItem: view1)
or for read you can add the default equal value like:
addConstraint(item: view2, attribute: . bottom, relatedBy: .equal, toItem: view1)
It is really easier to read and shorter than the default (but still works):
let c = NSLayoutConstraint(item: view2, attribute: .bottom, relatedBy: .equal, toItem: view1, attribute: .bottom, multiplier: 1.0, constant: 0.0)
addConstraint(c)
I hope it helps.
Le 7 oct. 2016 à 07:40, AnnieNinaJoyceV [email protected] a écrit :
Do you mind sharing you fix? It will be very helpful.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub #61 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/ABxqpP-0wonDZIQ8dJXxSyZs4EOivP_Bks5qxdtNgaJpZM4KBXhW.
from stevia.
Using Cartography and Stevia to complement each other, I suggest.
from stevia.
@rayman-v Happy to announce that this use case is now simplified in latest version https://github.com/freshOS/Stevia/releases/tag/3.1.0
layout(
0,
|view1.size(100)
)
alignBottoms(view1-4-view2.size(40))
alignBottoms(view1, view2)
If you ever prefer the equation style (which is longer in my opinion in this case), you could also use :
view1.Bottom == view2.Bottom
Hope this helps, have a fantastic day !
PS: You suggested above using both carthography and Stevia, would you have examples of use cases that are not supported by Stevia ?
from stevia.
What if I want to keep view2 always in the bottom of view1. Not bottom align, if view1 height ends at 250 then view2 should have an origin.y on 251
from stevia.
There are many ways to stack two views together vertically.
Native Stackview
By using native UIStackView
Use Equation Api
view2.Top == view1.Bottom
Using layout
layout(
view1,
view2
)
You can find the full documentation here : https://github.com/freshOS/Stevia/wiki/2.-Layout
Let me know if this helps :)
from stevia.
Related Issues (20)
- Stick two views with space between HOT 4
- 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.