-
-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update the Wiki, more complex examples #138
Comments
@norbdev I'm all for it, could you elaborate with the type of layout you maybe had trouble with? |
For one, I think you should have an example specifically explaining that layout doesn't create constraints to the parent by default. This has tripped me up many times:
|
|
@s4cha how can I control the overlapping behavior, I was thinking something like ZStack behavior but couldn't find examples :( |
Hi @sdyalor, Stevia is pure Autolayout so you can always (and should) use the native way. import UIKit
import Stevia
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let v1 = UIView()
v1.backgroundColor = .red
let v2 = UIView()
v2.backgroundColor = .blue
view.subviews {
v1
v2
}
v1.size(100).centerInContainer()
v2.size(100).centerHorizontally(offset: 50).centerVertically(offset: 50)
// v1.layer.zPosition = 1 // This makes the red (v1) view show on top
}
} Another solution would be to use UIView Hope this helps, |
@s4cha what about the same example but with "Visual Layout Api"? |
The title says everything.
The text was updated successfully, but these errors were encountered: