Skip to content

Instantly share code, notes, and snippets.

@harryhan24
Forked from baeyeongpyo/Anko_Layout_post5.kt
Created August 4, 2018 07:26
Show Gist options
  • Select an option

  • Save harryhan24/e118295aa0ee46fa3c007ea9fa801638 to your computer and use it in GitHub Desktop.

Select an option

Save harryhan24/e118295aa0ee46fa3c007ea9fa801638 to your computer and use it in GitHub Desktop.
class AnkoUIMaker(val context: Context) {
private val constraintlayoutID = R.id.ankoConstraintLayout
fun UiMake(): View =
context.constraintLayout {
id = constraintlayoutID
// 추가
textView("Anko Hello").lparams(wrapContent, wrapContent) {
startToStart = constraintlayoutID
endToEnd = constraintlayoutID
topToTop = constraintlayoutID
bottomToBottom = constraintlayoutID
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment