question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[MaterialButton] OutlinedButton not showing

See original GitHub issue

Description: MaterialButton in Widget.MaterialComponents.Button.OutlinedButton style doesn’t show anything.

image

Expected behavior:

image

Source code:

<LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <com.google.android.material.button.MaterialButton
            android:id="@+id/material_button"
            style="@style/Widget.MaterialComponents.Button"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Default Button"/>

        <com.google.android.material.button.MaterialButton
            android:id="@+id/material_unelevated_button"
            style="@style/Widget.MaterialComponents.Button.UnelevatedButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Unelevated Button"/>

        <com.google.android.material.button.MaterialButton
            android:id="@+id/materialoutline_button"
            style="@style/Widget.MaterialComponents.Button.OutlinedButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Outlined Button"/>

        <com.google.android.material.button.MaterialButton
            android:id="@+id/material_text_button"
            style="@style/Widget.MaterialComponents.Button.TextButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Text Button"/>

        <com.google.android.material.button.MaterialButton
            android:id="@+id/material_icon_button"
            style="@style/Widget.MaterialComponents.Button.Icon"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Icon Button"
            app:icon="@drawable/success"/>

        <com.google.android.material.button.MaterialButton
            android:id="@+id/material_icon_text_button"
            style="@style/Widget.MaterialComponents.Button.TextButton.Icon"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Icon Text button"
            app:icon="@drawable/success"/>
    </LinearLayout>

Android API version: API Code 25

Material Library version: 1.2.0-alpha03

Device: Android emulator 7.1

It works with 1.1.0-rc01.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

11reactions
combatistorcommented, Sep 17, 2020

This bug reappears in version 1.2.1

8reactions
samuelowinocommented, Jul 23, 2021

This issue reappears in 1.4.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

android - Outlined MaterialButton doesn't show any border
I defined the button in my layout, providing stroke width and stroke color but it isn't showing any border, what am I doing...
Read more >
Common buttons – Material Design 3
Outlined button 5. ... Typography: Button text is in sentence case, no ALL CAPS; Types: Three new button types – elevated button, filled...
Read more >
MaterialButton - Android Developers
A convenience class for creating a new Material button. This class supplies updated Material styles for the button in the constructor.
Read more >
Outline Material Button in Android Studio - YouTube
Material Design Outlined Button | Outline Material Button in Android Studio. 871 views 1 year ago. Tech Upshot. Tech Upshot. 38 subscribers.
Read more >
Buttons — Material Components For Android
Material Button Android is a customizable button component with updated visual ... and setting a new background means MaterialButton can no longer guarantee ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found