Last active
June 28, 2016 17:34
-
-
Save nicksnyder/cc5b7d36ac9f387894ada87e5151920c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import LayoutKit | |
/// A simple hello world layout using LayoutKit. | |
public class HelloWorldLayout: InsetLayout { | |
public init() { | |
super.init( | |
insets: UIEdgeInsets(top: 4, left: 4, bottom: 4, right: 8), | |
sublayout: StackLayout( | |
axis: .horizontal, | |
spacing: 4, | |
sublayouts: [ | |
SizeLayout<UIImageView>(width: 50, height: 50, config: { imageView in | |
imageView.image = UIImage(named: "earth.png") | |
}), | |
LabelLayout(text: "Hello World!", alignment: .center) | |
] | |
) | |
) | |
} | |
} | |
helloWorld.arrangement().makeViews(inView: rootView) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment