android - Android中的com.google.android.material.button.MaterialButton“OutlinedButton”样式
问题描述
我使用了MaterialButton,但我的预期设计没有出现。在我的 xml 代码和样式下面。
我需要背景的白色而不是橙色,我可以做些什么来实现这一点。请提供您的建议。
// 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" />
解决方案
用于app:backgroundTint="@color/white"
您的 MaterialButton
推荐阅读
- python - 对背景较浅的图像进行伽马校正
- excel - excel vba组合图根据动态选择确定哪些应该是区域,哪些是线标记
- android - 现有的 android studio 项目模块问题
- r - 如何均匀地绘制半年度数据?
- image - 如何提取 MVIMG 的照片/视频组件?
- amazon-web-services - 从远程 Solaris 服务器到 AWS S3 存储桶的 FTP 文件
- javascript - 需要帮助将 excel 公式转换为 Javascript 逻辑
- python - 从 h2o 中,有没有办法将 N 个文件夹交叉验证结果导出到数据框中?
- angular - 使用 EventEmitter Angular 2 共享数据
- excel - worksheet_change 事件仅在删除单元格输入时触发