Github wiki page显示了Activity
实例中要使用的示例:
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
}
}
}
如何在Fragment
内做到同样的事情呢?
我试着把verticalLayout
块放在onCreateView
块,但这个方法无法解决.我增加了anko-support-v4
个依赖项,但仍然没有运气.