The Github wiki page show this example to be used in Activity
instance:
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
verticalLayout {
padding = dip(30)
editText {
hint = "Name"
textSize = 24f
}
editText {
hint = "Password"
textSize = 24f
}
button("Login") {
textSize = 26f
}
}
}
How to do the same inside a Fragment
?
I tried to put that verticalLayout
block in onCreateView
but the method cannot be resolved. I have added anko-support-v4
dependency, but still no luck.
verticalLayout
method. My guess is that it is defined onActivity
, so it works inside it, but not outside it. – StreptothricinActivity
. Finally, I've found a workaround, will post the answer soon – Kragh