I'm adding MaterialButton
to my android project and it only shows the text instead of both text and icons, here is my code :
<com.google.android.material.button.MaterialButton
android:id="@+id/homeBtn1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="8dp"
android:gravity="center"
android:textAllCaps="true"
android:textColor="#F8F8F8"
android:background="#3F51B5"
android:text="@string/findTrans"
app:icon="@drawable/white_bus_icon"
app:iconGravity="textStart"
app:iconTint="@null"
app:layout_constraintBottom_toTopOf="@+id/button2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView2"
/>
and here is how the buttons looks :