【发布时间】:2021-08-08 08:24:44
【问题描述】:
我正在使用 AlertDialog 的 setMultiChoiceItems。复选标记位于选择文本的垂直中心。我希望它位于顶部。该怎么做?
(Kotlin 代码。Java 答案会很好。)
AlertDialog.Builder (this).run {
val choices = arrayOf(
"Option 1 is very long. It is more than 3 lines. I would like to align the text top with the check box top.",
"Option 2 is very long. It is more than 3 lines. I would like to align the text top with the check box top.",
"Option 3 is very long. It is more than 3 lines. I would like to align the text top with the check box top.",
)
val booleanSelections = booleanArrayOf(true, true, true)
setMultiChoiceItems(choices, booleanSelections, null)
show()
}
【问题讨论】:
-
确实如此。这是一个麻烦。希望你能得到解决方案。物品周围的框架也很好。
标签: java android kotlin android-layout kotlin-android-extensions