Answer the question
In order to leave comments, you need to log in
How to center an icon in a button?
You need to make a button with an icon.
I do it like this:
<Button
android:layout_width="300dp"
android:layout_height="70dp"
android:background="@color/colorAccent"
android:drawableLeft="@drawable/ic_dashboard_black_24dp"
android:text="start"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
Answer the question
In order to leave comments, you need to log in
Make a CardView and position an ImageView with a TextView. Add an OnClickListener, ripple effect, and you'll have a custom button.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question