[英]PreferenceFragmentCompat has padding on PreferenceCategory that I can't get rid of
[英]Can't get rid of bottom padding on button
我有一個按鈕。 它似乎有底部填充我無法擺脫:
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Foo"/>
在資源編輯器中,我可以單擊按鈕,然后在那里看到按鈕底邊下方的填充。 這似乎阻止我在父RelativeLayout中垂直居中按鈕。
我嘗試設置padding = 0dip和layout_margin = 0dip,沒有效果。 底部填充持續存在。
謝謝
設置android:layout_marginBottom =“ - 5dp”為按鈕很好地為我工作。
我很晚才回答這個問題,但是如果有人遇到類似的用例( Removing all the inner and outer padding in Button
),請考慮分享
<Button
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="-5dp"
android:layout_marginLeft="-5dp"
android:layout_marginRight="-5dp"
android:layout_marginTop="-5dp"
android:minHeight="-2dp"
android:minWidth="-2dp"
android:text="TextView"
android:textSize="12sp" />
Hmn真奇怪。 從來沒有注意到。 可能是因為你通常需要在你的按鈕周圍留一點空間。
還嘗試了margin / padding = 0dp並且確實不起作用。
你可以設置android:layout_marginBottom =“ - 10dp”但是:)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.