TextView中的网格布局内动力高度局内、高度、动力、网格布

2023-09-05 00:01:23 作者:浪荡一生

我在使用网格布局利用图书馆的兼容性(无没试过)有问题。我使用应用程序:layout_gravity =fill_horizo​​ntal而不是安卓layout_gravity =fill_horizo​​ntal,但里面所有的内容在的TextView 不显示。为了显示一切,我必须设置的的TextView 标题的高度,但我想一个动态的高度,没有一套高度。

I have a problem using GridLayout using library compatibility (not tried without). I am using app:layout_gravity="fill_horizontal" instead of android:layout_gravity="fill_horizontal" but all the content inside the TextView is not displayed. In order to display everything, I have to set the height of the TextView "Title" but I want a dynamic height, not a set height.

你知道吗?

推荐答案

您必须设置 layout_width =0dp layout_gravity =fill_horizo​​ntal 的TextView的。

You have to set layout_width="0dp" and layout_gravity="fill_horizontal" for the TextView.

<TextView
 android:layout_width="0dp"
 app:layout_gravity="fill_horizontal" />

请,在这里看到完整的例子:https://groups.google.com/d/msg/android-developers/OmH3VBwesOQ/ZOGR0SGvC3cJ或在这里:http://daniel-$c$cs.blogspot.com/2012/01/gridlayout-view-clipping-issues.html

Please, see full example here: https://groups.google.com/d/msg/android-developers/OmH3VBwesOQ/ZOGR0SGvC3cJ or here: http://daniel-codes.blogspot.com/2012/01/gridlayout-view-clipping-issues.html

 
精彩推荐
图片推荐