在RecycleView
支架设定wrap_content
:为什么wrap_content没有效果?
<?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贴片PNG太高。 9贴片PNG扩展但不缩小。文本宽度设置为'match_parent',所以我假设你关心的是'wrap_content'高度上多余的垂直空白。 – CommonsWare
in TextView android:layout_width =“wrap_content” 并使用9-patch PNG – zombie
TextView *不能小于9补丁。这是*最小尺寸*。 –