TextView中的网格布局内动力高度 [英] Dynamic height of TextView within a GridLayout

查看:114
本文介绍了TextView中的网格布局内动力高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用网格布局利用图书馆的兼容性(无没试过)有问题。我使用应用程序: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" />

请,在这里看到完整的例子:<一href="https://groups.google.com/d/msg/android-developers/OmH3VBwesOQ/ZOGR0SGvC3cJ">https://groups.google.com/d/msg/android-developers/OmH3VBwesOQ/ZOGR0SGvC3cJ或在这里:<一href="http://daniel-$c$cs.blogspot.com/2012/01/gridlayout-view-clipping-issues.html">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

这篇关于TextView中的网格布局内动力高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆