0

enter image description here

I've already looked at solutions for this on stackoverflow, but none have solved my issue, any ideas? The button is not filling parent container. I've tried RelativeLayout, and same behavior.

already tried this -https://stackoverflow.com/questions/20397575/android-button-height-in-layout-not-filling-the-parent

My xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="60dp"
android:layout_width="match_parent"
>
<com.google.android.material.textfield.TextInputLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_weight="1"
    >
    <com.google.android.material.textfield.TextInputEditText
        android:id="@+id/awayMsg_input"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:hint="TextGoes here"
        android:imeOptions="actionDone"
        />
</com.google.android.material.textfield.TextInputLayout>
<Button
    android:id="@+id/awayMsg_btn"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:backgroundTint="@color/primary"
    android:text="@string/main_inputFieldBtn"
    />
</LinearLayout>
yazmnh87
  • 316
  • 5
  • 12
  • This could be the reason why, "A standard button is not supposed to be used at full width which is why you experience this", thank you for sharing. I'll see if I can follow some suggestions in that post you provided. – yazmnh87 Apr 22 '21 at 16:54
  • @HenryTwist I just set the background. attr instead of backgroundTint and this fixed it for me, thank you again:) – yazmnh87 Apr 22 '21 at 16:56
  • You can easily tell by looking at the bounding boxes that Android Studio places on the views in the preview. If the blue bounding box is the correct height, then it's a styling issue like I said, otherwise there's something else going on. – Henry Twist Apr 22 '21 at 16:56
  • Ah perfect, no problem! Do remember though that by replacing the background you lose some styling of the button. There are some solutions on the post I linked that don't involve replacing the background entirely. – Henry Twist Apr 22 '21 at 16:57
  • 1
    @HenryTwist yes, I'll look for some additional references that can help me keep the styling options intact – yazmnh87 Apr 22 '21 at 16:59

0 Answers0