mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 02:54:11 +08:00
fix(ios): actionitem coloring with 15+
This commit is contained in:
@ -357,19 +357,14 @@ export class ActionBar extends ActionBarBase {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (color) {
|
if (color) {
|
||||||
|
const titleTextColor = NSDictionary.dictionaryWithObjectForKey(color.ios, NSForegroundColorAttributeName);
|
||||||
if (majorVersion >= 15) {
|
if (majorVersion >= 15) {
|
||||||
const appearance = navBar.standardAppearance ?? UINavigationBarAppearance.new();
|
const appearance = navBar.standardAppearance ?? UINavigationBarAppearance.new();
|
||||||
appearance.titleTextAttributes = NSDictionary.dictionaryWithObjectForKey(color.ios, NSForegroundColorAttributeName);
|
appearance.titleTextAttributes = titleTextColor;
|
||||||
} else {
|
|
||||||
// legacy styling
|
|
||||||
navBar.titleTextAttributes = <any>{
|
|
||||||
[NSForegroundColorAttributeName]: color.ios,
|
|
||||||
};
|
|
||||||
navBar.largeTitleTextAttributes = <any>{
|
|
||||||
[NSForegroundColorAttributeName]: color.ios,
|
|
||||||
};
|
|
||||||
navBar.tintColor = color.ios;
|
|
||||||
}
|
}
|
||||||
|
navBar.titleTextAttributes = titleTextColor;
|
||||||
|
navBar.largeTitleTextAttributes = titleTextColor;
|
||||||
|
navBar.tintColor = color.ios;
|
||||||
} else {
|
} else {
|
||||||
navBar.titleTextAttributes = null;
|
navBar.titleTextAttributes = null;
|
||||||
navBar.largeTitleTextAttributes = null;
|
navBar.largeTitleTextAttributes = null;
|
||||||
|
Reference in New Issue
Block a user