动作的标题文字颜色没有改变,如何更改动作栏的标题文字颜色?这是我的let now = new Date()
// Get the current time in LA using string matching to enable the offset to be calculated
// This allows for daylight savings to be considered
// Caution the LocaleTimeString is en-US formatted. Take care if using a different locale
let timeInLA = now.toLocaleTimeString('en-US', { timeZone: 'America/Los_Angeles' })
.match(/([0-1]?[0-9])\:([0-5]?[0-9])\:[0-5]?[0-9]\s(AM|PM)/)
// trim first element of match
.slice(1)
// take account of AM/PM and convert values to integers
.map( (e,i,a) => i==0 && a[3] =='PM' ? +e+12 : +e)
// trim AM/PM
.slice(0,-1)
// positive values mean local time is ahead of LA
let offsets = [now.getHours(),now.getMinutes()].map((e,i) => e-timeInLA[i])
// sum up hours and minutes to get totalOffset and convert to ms
let totalOffsetMS = (offsets[0]*3600 + offsets[1]*60)*1000
// local midnight Tomorrow - add 24 hours and zero other values
let localMidnightTomorrow = new Date(+now.setHours(24,0,0,0))
// LA midnight will happen at the local midnight time with the offset added
let localTimeWhenMidnightInLA = new Date(+localMidnightTomorrow + totalOffsetMS)
console.log(`It will be "${localTimeWhenMidnightInLA.toDateString()} ${localTimeWhenMidnightInLA.toTimeString()}" in your location when it is midnight in LA tomorrow`)
代码
style.xml
答案 0 :(得分:0)
作为我的问题https://stackoverflow.com/a/45879575/6914992的@Sunny答案(What is the difference between colorPrimary and colorPrimaryDark in themes)。尝试通过主题背景更改颜色。
colorPrimary-应用栏的颜色。
colorPrimaryDark –状态栏和上下文应用栏的颜色;这通常是colorPrimary的深色版本。
您可以使用以下链接设置样式。
https://blog.xamarin.com/material-design-for-your-xamarin-forms-android-apps/
注意,如果不是这样,请赞成Sunny的回答,谢谢