PinLayout
PinLayout copied to clipboard
Layout group of views
Hi! Could not add the possibility of changing views at once for the whole group, as Stack View
.
I'm tired of trying to sort through all possible combinations of methods in the FlexLayout
.
The task is simple at first glance:
![2018-06-07 16 17 58](https://user-images.githubusercontent.com/7115804/41102216-05032762-6a6f-11e8-8385-f74679cf586b.png)
As a result, I again returned to a clean PinLayout
.
It would be great to add views to the main view and write the following code:
cardView.add(bigTitle, blurView)
blurView.contentView.add(price, textView)
textView.add(title, subtitle)
card.pin.stack(axis: .vertical, alignment: .fill, distribution: .equalSpacing) {
bigTitle.pin.inset(20).sizeToFit(.width, .heightFlexible).maxHeight(50%)
blurView.stack(axis: .horizontal, alignment: .center, distribution: .equalSpacing, spacing: 4, inset: 20) {
price.pin.height(28).maxWidth(50%).sizeToFit(.widthFlexible).priority(.highest)
textView.pin.stack(axis: .vertical, alignment: .fill, distribution: .fillEqually, spacing: 2)
}
}
Any update on this? Would be really helpful.
Hi @dillidon @enricenrich, creating a stackview it is quite complex, and currently, I didn't want to add this complexity and high-level API to PinLayout. That's why I started another project StackViewLayout (https://github.com/layoutBox/StackViewLayout/tree/dev), the project is 95% complete, but I didn't have enough time to complete it. The API is inspired by flexbox.
Thanks for the update @lucdion!
Hi! Could not add the possibility of changing views at once for the whole group, as
Stack View
.I'm tired of trying to sort through all possible combinations of methods in the
FlexLayout
. The task is simple at first glance:![]()
As a result, I again returned to a clean
PinLayout
.It would be great to add views to the main view and write the following code:
cardView.add(bigTitle, blurView) blurView.contentView.add(price, textView) textView.add(title, subtitle) card.pin.stack(axis: .vertical, alignment: .fill, distribution: .equalSpacing) { bigTitle.pin.inset(20).sizeToFit(.width, .heightFlexible).maxHeight(50%) blurView.stack(axis: .horizontal, alignment: .center, distribution: .equalSpacing, spacing: 4, inset: 20) { price.pin.height(28).maxWidth(50%).sizeToFit(.widthFlexible).priority(.highest) textView.pin.stack(axis: .vertical, alignment: .fill, distribution: .fillEqually, spacing: 2) } },
I wrote a PinStackView relies on PinLayout in https://github.com/lalawue/PinStackView, you can take a try.
Very old topic. Closing it, sorry