在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補丁。這是*最小尺寸*。 –