如何将anko小部件添加到另一个anko小部件中?

时间:2018-04-15 22:02:54

标签: android kotlin anko

如下所示,如何将# density plot for dataset 1 plot1 <- ggtern(data = test,aes(x=x, y=y, z=z)) plot1+ stat_density_tern(geom="polygon", aes(fill = ..level.., alpha = ..level..)) + theme_rgbw() + labs(title = "Example Density/Contour Plot") + scale_fill_gradient(low = "lightblue",high = "blue") + guides(color = "none", fill = "none", alpha = "none")+ scale_T_continuous (limits = c(0.225,0.215))+ scale_L_continuous (limits= c(0.255,0.245))+ scale_R_continuous (limits = c(0.53,0.54)) # density plot for dataset 2 plot2 <- ggtern(data = test2,aes(x=x1, y=y1, z=z1)) plot2 + stat_density_tern(geom="polygon", aes(fill = ..level.., alpha = ..level..)) + theme_rgbw() + labs(title = "Example Density/Contour Plot") + scale_fill_gradient(low = "lightgreen",high = "green") + guides(color = "none", fill = "none", alpha = "none")+ scale_T_continuous (limits = c(0.225,0.215))+ scale_L_continuous (limits= c(0.255,0.245))+ scale_R_continuous (limits = c(0.53,0.54)) 添加到该警报中?

customDialog

1 个答案:

答案 0 :(得分:0)

使用扩展功能。

fun Context.customDialog() = verticalLayout {
    padding = dip(16)

    val shortName = editText {
        hint = "Short name"
        textSize = 24f
    }

    val pwd = editText {
        hint = "Password"
        textSize = 24f
    }
}

alert("Let me join in") {
    customView {
        verticalLayout {
            customDialog()

            yesButton {
                isCancelable = true
            }

            noButton { it.dismiss() }
        }
    }

}.show()