【发布时间】:2016-10-11 21:16:07
【问题描述】:
将wrap_content 设置在RecycleView 支架中:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent"
android:background="@android:color/black">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView3"
android:textColor="@android:color/white"
android:textSize="17dp"
android:background="@drawable/bubbleblue170x140_2" />
</RelativeLayout>
但是TextView 中的文本没有被包裹,气泡中有很多空白空间,TextView 内部。
如何强制在 iOS 版本中看到这样的内容:
在 Android 中使用9-patch 图像作为background。
【问题讨论】:
-
即兴发挥,您的 9-patch PNG 太高了。 9 补丁 PNG 扩展但不收缩。文本宽度设置为
match_parent,所以我认为您关心的是wrap_content高度上的额外垂直空白。 -
在 TextView android:layout_width="wrap_content" 中使用 9-patch PNG
-
TextView 不能小于 9补丁。这是最小尺寸。
标签: android android-layout android-recyclerview android-wrap-content