mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
tab text color set after items changed
This commit is contained in:
@ -64,9 +64,9 @@ function onItemsPropertyChanged(data: dependencyObservable.PropertyChangeData) {
|
||||
view.android.setOnTabChangedListener(null);
|
||||
view.android.setOnTabChangedListener(view._listener);
|
||||
|
||||
if (view.selectedBackgroundColor) {
|
||||
var tabHost = <android.widget.TabHost>view.android;
|
||||
var tabHost = <android.widget.TabHost>view.android;
|
||||
|
||||
if (view.selectedBackgroundColor) {
|
||||
for (var tabIndex = 0; tabIndex < tabHost.getTabWidget().getTabCount(); tabIndex++) {
|
||||
var vg = <android.view.ViewGroup>tabHost.getTabWidget().getChildTabViewAt(tabIndex);
|
||||
|
||||
@ -82,6 +82,12 @@ function onItemsPropertyChanged(data: dependencyObservable.PropertyChangeData) {
|
||||
vg.setBackgroundDrawable(stateDrawable);
|
||||
}
|
||||
}
|
||||
|
||||
for (var tabIndex = 0; tabIndex < tabHost.getTabWidget().getTabCount(); tabIndex++) {
|
||||
var tabChild = <android.view.ViewGroup>tabHost.getTabWidget().getChildTabViewAt(tabIndex);
|
||||
var t = <android.widget.TextView>tabChild.getChildAt(1);
|
||||
t.setTextColor(view.color.android);
|
||||
}
|
||||
}
|
||||
}
|
||||
(<proxy.PropertyMetadata>common.SegmentedBar.itemsProperty.metadata).onSetNativeValue = onItemsPropertyChanged;
|
||||
|
Reference in New Issue
Block a user