Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I've used MaterialButton but my expected design not came. Below my xml code and style.

I've need white color of the background instead of the orange color, what I can do to achieve this. Please provide your suggestion.

enter image description here

// Material Design version I've used
implementation 'com.google.android.material:material:1.2.1'

**Color primary** means orange color.

<com.google.android.material.button.MaterialButton
                android:id="@+id/btnWatchVideo"
                style="@style/Widget.MaterialComponents.Button.OutlinedButton"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="10dp"
                android:text="@string/watch_video"
                android:textColor="@color/colorBlack"
                android:visibility="visible"
                app:strokeColor="@color/colorBlack"
                app:strokeWidth="2dp" />


<style name="SliderThemeBlack" parent="Theme.MaterialComponents.Light.NoActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorBlack</item>
        <item name="colorAccent">@color/colorPrimary</item>
        <item name="android:screenOrientation">portrait</item>
        <item name="android:windowIsTranslucent">true</item>
        <item name="android:windowBackground">@android:color/transparent</item>
        <item name="android:windowDrawsSystemBarBackgrounds">true</item>

Manifest:
    <activity android:name="xxx" 
    android:theme="@style/SliderThemeBlack"  android:windowSoftInputMode="stateHidden" />

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
399 views
Welcome To Ask or Share your Answers For Others

1 Answer

use app:backgroundTint="@color/white" to your MaterialButton


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...