0
我在XML佈局中有一個帶有layout_height="wrap_content"
的TextView,但文本不在文本框的頂部,有一些像素填充。TextView with layout_height =「wrap_content」沒有完全包裹
<TextView
android:id="@+id/name"
android:background="@color/text_orange"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="bla bla bla"
android:textColor="@color/primary_text"
android:textSize="17sp" />
我該如何實現文本框完全包裹在文本週圍,文本和邊框之間沒有任何填充?
不幸的是還有一些填充... – swalkner
嘗試在您的佈局上設置負邊距,並讓我知道這是否解決了您的問題。 'android:layout_marginTop =「 - 5dp」 android:layout_marginBottom =「 - 5dp」' – Kristo
是的,它確實 - 我現在知道是什麼導致了這種情況:例如Å看起來不錯,但A不(=需要負邊距) – swalkner