LinkedInAttic / LayoutKit

LayoutKit is a fast view layout library for iOS, macOS, and tvOS.
http://layoutkit.org
Apache License 2.0
3.16k stars 267 forks source link

OverlayLayout needed #100

Closed kioqq closed 7 years ago

kioqq commented 7 years ago

Hello guys, i don't understand how make layout in my project like on picture:

screen shot 2017-02-09 at 2 09 02 pm

2 and 3 index is LabelLayout

Please help :/

stevejcox commented 7 years ago

hey @ki0k1

I've had some similar challenges and couldn't work out the best LayoutKit way to do it. Hopefully someone else can offer a better solution.

However the way I achieved this was to simply create a subview where necessary.

In your example I would have 1 and 2 in the same view (add 2 as a sub layout to 1), then add a basic UIView and add 3 to that.

staguer commented 7 years ago

There's definitely a need for an overlay layout.

You can build one yourself, Issue #90 actually has a sample project that happens to include an OverlayLayout.swift, which might help as a starting example.

A poor workaround might be to add a zero-size layout in that corner and add to it a sublayout that extends outside of its bounds. Whether this would work probably depends on whether Layout 3 has a fixed static size.

dgattey commented 7 years ago

I can take this on!

dgattey commented 7 years ago

Here’s the PR for OverlayLayout https://github.com/linkedin/LayoutKit/pull/127 @nicksnyder @staguer @jingwei-huang1

staguer commented 7 years ago

I wonder why I can't assign this issue to @dgattey

nicksnyder commented 7 years ago

@staguer https://github.com/isaacs/github/issues/100

dgattey commented 7 years ago

Available in latest!

staguer commented 7 years ago

Thanks!