SegmentedBar with nothing selected


I have define a segmentedBar which I’m using as part of a check sheet.

 <SegmentedBar loaded="sbLoaded" selectedIndex="" class="segButton" id="segmobile" height="30" row="7" col="1">
						<SegmentedBarItem title="√" />
									<SegmentedBarItem title="X" />

If I fire up the code in the iOS emulator, none of the segments are selected, as set by selectedIndex="", however if I run the code on a physical device, the first segment is selected. How do I ensure that when the page is first displayed that none of the segmentedBars has any selected Elements.


Are the iOS versions on Simulator and Device are same? May I know which version it is?


11.4 on Simulator (5s) and 11.4.1 on physical device (iPhone X).

5s below

iPhone X Below


I don’t think this is possible in Android, neither in iOS as per NativeScript’s implementation. The expected behavior is to keep first item selected, if you want to override then add loaded event to your segment bar and do this,

 const nativeView = args.object.nativeView;
 nativeView.selectedSegmentIndex = -1;


Thanks will give it ago, although I don’t understand how the emulator is ok with my code and the physical device isn’t.


Unfortunately I couldn’t get it to work it, failed on both Emulator and Physical device. In the end I switched to a 3 way button with the middle being the default, left for Pass and right for Fail. I could do with being able to narrow the middle button independently, but will live with this for now.


Today I updated my Xcode and iOS version to 11.4.1, it works as expected on my end. Setting selectedSegmentIndex to -1 deselects all items.