PinLayout icon indicating copy to clipboard operation
PinLayout copied to clipboard

Layout group of views

Open dillidon opened this issue 6 years ago • 4 comments

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

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)
  }
}

dillidon avatar Jun 07 '18 13:06 dillidon

Any update on this? Would be really helpful.

enricenrich avatar Jan 31 '19 12:01 enricenrich

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.

lucdion avatar Jan 31 '19 19:01 lucdion

Thanks for the update @lucdion!

enricenrich avatar Jan 31 '19 19:01 enricenrich

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

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.

lalawue avatar Jun 19 '21 15:06 lalawue

Very old topic. Closing it, sorry

lucdion avatar Mar 01 '23 20:03 lucdion