How to properly remove padding (or margin?) around buttons in Android?

前端 未结 13 939
醉梦人生
醉梦人生 2020-12-13 04:50

Currently, I have the following bottom log in button.

When button is not being pressed

When button is being pressed

The XML loo

相关标签:
13条回答
  • 2020-12-13 05:53

    After trying lots of solution, Finally I came to a conclusion that with tag alone we can't achieve this. to remove this unwanted space around button my solution is as below:

     <RelativeLayout
        android:id="@+id/myButtonUnderlay"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom"
        android:visibility="visible">
    <Button
        android:id="@+id/save_button"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:layout_marginTop="-5dp" 
        android:layout_marginBottom="-5dp"
        android:layout_above="@+id/content_scrollview"
        android:layout_gravity="bottom"
        android:background="@drawable/ripple_theme"
        android:enabled="true"
        android:text="SetUp Store"
        android:textColor="#fff"
        android:textSize="18sp"
        android:visibility="gone"
        tools:visibility="visible"
        style="@style/MediumFontTextView" />
    </RelativeLayout>
    
    0 讨论(0)
提交回复
热议问题