Answers for "how to align button and icon in button android studio"

1

center icon material button android

<com.google.android.material.button.MaterialButton
            android:layout_width="50dp"
            android:layout_height="50dp"
            android:layout_marginTop="16dp"
            android:insetLeft="0dp"
            android:insetTop="0dp"
            android:insetRight="0dp"
            android:insetBottom="0dp"
            app:icon="@drawable/ic_add"
            app:iconGravity="textStart"
            app:iconPadding="0dp"
            android:paddingStart="4dp"
            android:paddingEnd="4dp" />
Posted by: Guest on February-22-2021
1

button with icon android

<!-- ImageView which will used as a button with OnClickListener -->
    <ImageView
        android:id="@+id/imageView"
        android:layout_width="200dp"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        app:srcCompat="@drawable/homeicon" />
Posted by: Guest on June-25-2021

Code answers related to "how to align button and icon in button android studio"

Browse Popular Code Answers by Language