如何在Anko中设置layout_width和layout_gravity

时间:2018-08-20 00:22:43

标签: android kotlin anko

显然,TextViewGridLayout的默认行为是截取一半的文本。 This article说,您应该将TextView的{​​{1}}和layout_width=0dp设置为正确换行。我正在尝试使用Anko做到这一点,但我以为我做到了,但是当我做到这一点时,我得到的只是一大块空白。

layout_gravity=fill_horizontal

还有其他设置布局宽度和重力的方法吗?使用Anko真的无法将gridLayout { columnCount = 2 textView { text = "Effect" } textView { text = "It is a long established fact that a reader will be distracted by the readable content of a " + "page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less " + "normal distribution of letters, as opposed to using 'Content here, content here', making it " + "look like readable English." }.lparams { width = 0 this@verticalLayout.gravity = Gravity.FILL_HORIZONTAL } } 设置为layout_width吗?

0 个答案:

没有答案