{"action":"created","issue":{"url":"https://api.github.com/repos/linkedin/LayoutKit/issues/182","repository_url":"https://api.github.com/repos/linkedin/LayoutKit","labels_url":"https://api.github.com/repos/linkedin/LayoutKit/issues/182/labels{/name}","comments_url":"https://api.github.com/repos/linkedin/LayoutKit/issues/182/comments","events_url":"https://api.github.com/repos/linkedin/LayoutKit/issues/182/events","html_url":"https://github.com/linkedin/LayoutKit/issues/182","id":295936725,"number":182,"title":"StackLayout last item height seems wrong","user":{"login":"itskoBits","id":4847686,"avatar_url":"https://avatars3.githubusercontent.com/u/4847686?v=4","gravatar_id":"","url":"https://api.github.com/users/itskoBits","html_url":"https://github.com/itskoBits","followers_url":"https://api.github.com/users/itskoBits/followers","following_url":"https://api.github.com/users/itskoBits/following{/other_user}","gists_url":"https://api.github.com/users/itskoBits/gists{/gist_id}","starred_url":"https://api.github.com/users/itskoBits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/itskoBits/subscriptions","organizations_url":"https://api.github.com/users/itskoBits/orgs","repos_url":"https://api.github.com/users/itskoBits/repos","events_url":"https://api.github.com/users/itskoBits/events{/privacy}","received_events_url":"https://api.github.com/users/itskoBits/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-09T16:50:04Z","updated_at":"2018-02-12T03:04:56Z","closed_at":null,"author_association":"NONE","body":"Hi guys,\r\n\r\nI have some experience using LayoutKit, but I am struggling with a really simple use case. I am not sure if I I am missing something or if it is an issue within the library.\r\n\r\n### What I want to achieve.\r\nI have a view(**P**) with fixed size and I want to place two subviews inside. The first(**S1**) one is with fixed size, the second one(**S2**) has a fixed width and should fill the remaining height. I also want to have some spacing between the two subviews. \r\n\r\nHere is an image of what I try to achieve:\r\n![stack-correct](https://user-images.githubusercontent.com/4847686/36038987-dc666e1a-0dc9-11e8-93a9-deb8b944709b.png)\r\n\r\nThe blue view is the parent view with fixed size. The red view is the subview with fixed size. The black vertical line is what I want to fill the available space.\r\n\r\n### What I tried\r\nI tried implementing what I described earlier using StackLayout. However the last item (**S2**) in that layout has his height calculated wrongly. It's height ignores the item spacing defined by the StackLayout. Below is a sample code I tried.\r\n\r\n```\r\nlet iconLayout = SizeLayout<UIView>(width: 22, height: 22, config: { view in\r\n    view.backgroundColor = .red\r\n})\r\nlet verticalLineLayout = SizeLayout<UIView>(width: 3, config: { view in\r\n    view.backgroundColor = UIColor.black\r\n})\r\n\r\nlet stackLayout = StackLayout(axis: .vertical, spacing: 10, sublayouts: [iconLayout, verticalLineLayout])\r\n\r\nlet sizeLayout = SizeLayout(size: CGSize(width: self.view.frame.width, height: 100), sublayout: stackLayout, config: { view in\r\n    view.backgroundColor = .blue\r\n})\r\n```\r\n\r\nHere is an image of what I get as result.\r\n![stack-incorrect](https://user-images.githubusercontent.com/4847686/36038998-e22e25b8-0dc9-11e8-84de-2e346f134932.png)\r\n\r\nAm I missing something or is this an issue with LayoutKit? \r\nThank you!\r\n"},"comment":{"url":"https://api.github.com/repos/linkedin/LayoutKit/issues/comments/364818889","html_url":"https://github.com/linkedin/LayoutKit/issues/182#issuecomment-364818889","issue_url":"https://api.github.com/repos/linkedin/LayoutKit/issues/182","id":364818889,"user":{"login":"staguer","id":990117,"avatar_url":"https://avatars3.githubusercontent.com/u/990117?v=4","gravatar_id":"","url":"https://api.github.com/users/staguer","html_url":"https://github.com/staguer","followers_url":"https://api.github.com/users/staguer/followers","following_url":"https://api.github.com/users/staguer/following{/other_user}","gists_url":"https://api.github.com/users/staguer/gists{/gist_id}","starred_url":"https://api.github.com/users/staguer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/staguer/subscriptions","organizations_url":"https://api.github.com/users/staguer/orgs","repos_url":"https://api.github.com/users/staguer/repos","events_url":"https://api.github.com/users/staguer/events{/privacy}","received_events_url":"https://api.github.com/users/staguer/received_events","type":"User","site_admin":false},"created_at":"2018-02-12T03:04:55Z","updated_at":"2018-02-12T03:04:55Z","author_association":"CONTRIBUTOR","body":"Hello @itskoBits, I think you've indeed found a bug, thank you for reporting it. I have reproduced it with the help of the code that you've provided. I don't have a fix at this moment, but I think there's a workaround, please try setting a `minHeight` (any positive value should work, like 1 or 0.000001) on the `verticalLineLayout`."}}
{"actor":{"display_login":"staguer"}}