Kotlin / anko

Pleasant Android application development
Apache License 2.0
15.88k stars 1.29k forks source link

Anko layout preview,How to preview dialog layout? #577

Open SilenceConcentrate opened 6 years ago

SilenceConcentrate commented 6 years ago
alert("详细信息") {
                customView {
                    verticalLayout {
                        verticalPadding = dip(16)
                        textInputEditText {
                            setText(it.address)
                        }.lparams(width = matchParent) {
                            margin = dip(16)
                        }
                        textInputEditText {
                            setText(it.box.toString())
                        }.lparams(width = matchParent) {
                            margin = dip(16)
                        }
                    }
                }
                noButton { }
                positiveButton("保存") {

                }
            }.show()
4u7 commented 6 years ago

Unfortunately anko preview supports only AnkoComponents. https://github.com/Kotlin/anko/wiki/Anko-Layouts#ankocomponent

SilenceConcentrate commented 6 years ago

thanks