是否可以更改android 5.0的datepicker(以及timepicker)配色方案?
我尝试设置强调色,但这不起作用(有和没有android:):
<!-- colorPrimary is used for the default action bar background -->
<item name="colorPrimary">@color/purple</item>
<!-- colorPrimaryDark is used for the status bar -->
<item name="colorPrimaryDark">@color/purple_tint</item>
<!-- colorAccent is used as the default value for colorControlActivated
which is used to tint widgets -->
<item name="colorAccent">@color/purple_tint</item>
Run Code Online (Sandbox Code Playgroud)
来自原文:

对于这样的事情:

我想更改Android中日期/时间选择器对话框的默认颜色,以便它应该与我的应用程序的主题相匹配.我在Google上搜索了解决方案,但我找不到解决方案.
我正在做的是创造一种新的风格:
<style name="datepicker" parent="@android:style/Widget.DeviceDefault.DatePicker">
<!---TODO-->
<item name="android:focusedMonthDateColor">@android:color/holo_red_dark</item>
</style>
Run Code Online (Sandbox Code Playgroud)
不知道日期选择器对话的可用属性是什么.如果有人能发布链接就会很棒
添加样式后,我将其称为主要样式
<item name="android:datePickerStyle">@style/datepicker</item>
Run Code Online (Sandbox Code Playgroud)
不幸的是,这对我来说根本不起作用.
android android-datepicker android-timepicker android-styles
我正在开发一个托管的 Expo 项目(Expo SDK 版本 49)。我用来@react-native-community/datetimepicker显示日期选择器对话框:
import { View } from "react-native";
import RNDateTimePicker from "@react-native-community/datetimepicker";
const DatePickerTest = () => {
const value = new Date();
return (
<View style={{flex: 1}}>
<RNDateTimePicker
mode="date"
value={value}
/>
</View>
);
}
;
export default DatePickerTest;
Run Code Online (Sandbox Code Playgroud)
当我在 Android 上运行代码时,将使用继承自 Android 默认主题的标题和选择颜色(在我的例子中为绿色)呈现日期选择器:
我知道为了更改强调色,我需要进行更改styles.xml(android/app/src/main/res/values例如参见/sf/answers/3385891001/)。但是,在 Expo 管理的项目中,我无权访问该android文件夹。
如何在不退出 Expo 的情况下更改强调色?