When isUserInteractionEnabled is set to false, the segment bar remains fully operational. The expectation would be that it ignores any user activity, and that's how it works on iOS. The video below shows that SegmentedBar works regardless the setting being true or false.
<Page xmlns="http://schemas.nativescript.org/tns.xsd" navigatingTo="navigatingTo" class="page">
<Page.actionBar>
<ActionBar title="My App" icon="" class="action-bar">
</ActionBar>
</Page.actionBar>
<StackLayout>
<SegmentedBar class="m-20" id="modeSelector" loaded="barLoaded">
<SegmentedBarItem title="About" />
<SegmentedBarItem title="Menu" />
<SegmentedBarItem title="Reviews" />
</SegmentedBar>
<Button class="m-20" text="Set isUserInteractionEnabled to false" tap="setFalse" />
<Button class="m-20" text="Set isUserInteractionEnabled to true" tap="setTrue" />
<TextView class="m-20" text="" editable="false" loaded="textLoaded" />
</StackLayout>
</Page>
import { EventData } from 'data/observable';
import { Page } from 'ui/page';
import { TextView } from 'ui/text-view';
let bar, text: TextView;
export function barLoaded(args: EventData) {
bar = args.object;
}
export function textLoaded(args: EventData) {
text = <TextView>args.object;
}
export function setFalse(args) {
bar.isUserInteractionEnabled = false
text.text += "\nSet false";
}
export function setTrue(args) {
bar.isUserInteractionEnabled = true
text.text += "\nSet true";
}
$ tns info
All NativeScript components versions information
โโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโ
โ Component โ Current version โ Latest version โ Information โ
โ nativescript โ 3.0.3 โ 3.0.3 โ Up to date โ
โ tns-core-modules โ 3.0.1 โ 3.0.1 โ Up to date โ
โ tns-android โ 3.0.1 โ 3.0.1 โ Up to date โ
โ tns-ios โ โ 3.0.1 โ Not installed โ
โโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโ

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Hi @sserdyuk,
I confirm that this is a real issue for Android and that setting up the isUserInteractionEnabled to false via XML and code behind will not disable the interaction for the SegmentedBar. However, at this time there is not an appropriate workaround, that is applicable to this case. For further info keep track the issue.
@tsonevn The workaround is to use setEnabled on the tabs. Here's working code.
import { EventData } from 'data/observable';
import { Page, View } from 'ui/page';
import { SegmentedBar } from 'ui/segmented-bar';
import { TextView } from 'ui/text-view';
let bar: SegmentedBar, text: TextView;
export function barLoaded(args: EventData) {
bar = <SegmentedBar>args.object;
}
export function textLoaded(args: EventData) {
text = <TextView>args.object;
}
export function setFalse(args) {
// bar.isUserInteractionEnabled = false
setSegmentedBarClickable(false);
text.text += "\nSet false";
}
export function setTrue(args) {
//bar.isUserInteractionEnabled = true
setSegmentedBarClickable(true);
text.text += "\nSet true";
}
export function setSegmentedBarClickable(isClickable: boolean) {
if (bar.android) {
const tabWidget = bar.nativeView.getTabWidget(),
tabCount = tabWidget.getChildCount();
for (var i = 0; i < tabCount; i++) {
tabWidget.getChildAt(i).setEnabled(isClickable);
}
} else if (bar.ios) {
bar.isUserInteractionEnabled = isClickable
}
}
The issue is reproducible with NativeScript 4.1.
Archive.zip
Most helpful comment
@tsonevn The workaround is to use setEnabled on the tabs. Here's working code.