Issue
I want to center align the text in the extended floating action button but I'm not able to do that. As you can see in the image below the text is not centrally aligned.
Here's is the code for extended floating action button:
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:id="@+id/compress_start_fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:text="S"
app:backgroundTint="?android:colorAccent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:textColor="@color/textColorPrimaryDark"
app:layout_constraintStart_toStartOf="parent"
android:textAlignment="center"
/>
Am I doing anything wrong? Any help will be appreciated.
Solution
Please add these two lines in your ExtendedFloatingActionButton
android:paddingStart="0dp"
android:paddingEnd="0dp
Answered By - Shay Kin
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.