mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 05:17:53 +08:00
fix(ios-tabview): crash when setting tab text color (#7188)
This commit is contained in:
@ -27,5 +27,6 @@ export function loadExamples() {
|
|||||||
examples.set("tab-view-tab-text-font-size", "tab-view/tab-view-tab-text-font-size");
|
examples.set("tab-view-tab-text-font-size", "tab-view/tab-view-tab-text-font-size");
|
||||||
examples.set("tab-view-android-swipe", "tab-view/tab-view-android-swipe");
|
examples.set("tab-view-android-swipe", "tab-view/tab-view-android-swipe");
|
||||||
examples.set("tab-view-icon-title-placement", "tab-view/icon-title-placement");
|
examples.set("tab-view-icon-title-placement", "tab-view/icon-title-placement");
|
||||||
|
examples.set("tab-text-color", "tab-view/tab-text-color");
|
||||||
return examples;
|
return examples;
|
||||||
}
|
}
|
||||||
|
|||||||
24
apps/app/ui-tests-app/tab-view/tab-text-color.xml
Normal file
24
apps/app/ui-tests-app/tab-view/tab-text-color.xml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<Page>
|
||||||
|
<TabView tabTextColor="red">
|
||||||
|
<TabView.items>
|
||||||
|
|
||||||
|
<TabViewItem title="Tab 1">
|
||||||
|
<TabViewItem.view>
|
||||||
|
<Label text="Label 1" />
|
||||||
|
</TabViewItem.view>
|
||||||
|
</TabViewItem>
|
||||||
|
|
||||||
|
<TabViewItem title="Tab 2">
|
||||||
|
<TabViewItem.view>
|
||||||
|
<Label text="Label 2" />
|
||||||
|
</TabViewItem.view>
|
||||||
|
</TabViewItem>
|
||||||
|
|
||||||
|
<TabViewItem title="Tab 3">
|
||||||
|
<TabViewItem.view>
|
||||||
|
<Label text="Label 3" />
|
||||||
|
</TabViewItem.view>
|
||||||
|
</TabViewItem>
|
||||||
|
</TabView.items>
|
||||||
|
</TabView>
|
||||||
|
</Page>
|
||||||
@ -576,7 +576,7 @@ function getTitleAttributesForStates(tabView: TabView): TabStates {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const tabSelectedItemTextColor = tabView.style.selectedTabTextColor;
|
const tabSelectedItemTextColor = tabView.style.selectedTabTextColor;
|
||||||
const selectedTextColor = tabItemTextColor instanceof Color ? tabSelectedItemTextColor.ios : null;
|
const selectedTextColor = tabSelectedItemTextColor instanceof Color ? tabSelectedItemTextColor.ios : null;
|
||||||
result.selectedState = { [NSFontAttributeName]: font }
|
result.selectedState = { [NSFontAttributeName]: font }
|
||||||
if (selectedTextColor) {
|
if (selectedTextColor) {
|
||||||
result.selectedState[UITextAttributeTextColor] = selectedTextColor
|
result.selectedState[UITextAttributeTextColor] = selectedTextColor
|
||||||
|
|||||||
Reference in New Issue
Block a user