mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 21:01:34 +08:00
Fixed Issue 261
This commit is contained in:
@ -271,6 +271,7 @@ export class TabView extends common.TabView {
|
|||||||
// If we are loading a TabView inside a hidden fragment this check will prevent it from polluting the action bar.
|
// If we are loading a TabView inside a hidden fragment this check will prevent it from polluting the action bar.
|
||||||
if (this.android && this.android.isShown()) {
|
if (this.android && this.android.isShown()) {
|
||||||
this._addTabsIfNeeded();
|
this._addTabsIfNeeded();
|
||||||
|
this._setNativeSelectedIndex(this.selectedIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -444,6 +445,7 @@ export class TabView extends common.TabView {
|
|||||||
if (actionBar) {
|
if (actionBar) {
|
||||||
var actionBarSelectedIndex = actionBar.getSelectedNavigationIndex();
|
var actionBarSelectedIndex = actionBar.getSelectedNavigationIndex();
|
||||||
if (actionBarSelectedIndex !== index) {
|
if (actionBarSelectedIndex !== index) {
|
||||||
|
trace.write("TabView actionBar.setSelectedNavigationItem("+index+")", common.traceCategory);
|
||||||
actionBar.setSelectedNavigationItem(index);
|
actionBar.setSelectedNavigationItem(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -451,6 +453,7 @@ export class TabView extends common.TabView {
|
|||||||
// Select the respective page in the ViewPager
|
// Select the respective page in the ViewPager
|
||||||
var viewPagerSelectedIndex = this._android.getCurrentItem();
|
var viewPagerSelectedIndex = this._android.getCurrentItem();
|
||||||
if (viewPagerSelectedIndex !== index) {
|
if (viewPagerSelectedIndex !== index) {
|
||||||
|
trace.write("TabView this._android.setCurrentItem("+index+", true);", common.traceCategory);
|
||||||
this._android.setCurrentItem(index, true);
|
this._android.setCurrentItem(index, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user