我需要更改Confirm
中日期选择器的Cancel
/ WebView
按钮的颜色。现在它们在白色背景上显示为白色,所以我只是看不到它们。
[我读到WebView中的日期选择器对话框是本机android对话框,所以这是我现在尝试不成功的操作(文本颜色仍然是白色):
首先,我在布局文件的WebView中添加了样式:
<WebView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
style="@style/dialogTheme" />
在我的styles.xml
文件中,我添加了这种样式:
<style name="dialogTheme" parent="Theme.AppCompat.Light.Dialog.Alert">
<item name="android:colorPrimary">#00397F</item>
<item name="android:colorAccent">#ff0000</item>
<item name="android:textColor">#00FF00</item>
<item name="android:typeface">monospace</item>
<item name="android:textSize">10sp</item>
<item name="android:textColorPrimary">#ff0000</item>
</style>
我尝试了这些配置的许多组合,没有任何改变。
这应该解决:
在styles.xml
文件上添加此:
<style name="Widget.Button" parent="@style/Widget.AppCompat.Button">
<item name="android:textColor">@color/design_default_color_primary</item>
</style>