mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 21:01:34 +08:00

Less than 30 erros left, let's hope it still works Added lib.*.d.ts from typescript, removed lib and dom stuff, added by hand XHR, alert etc. .d.ts-es for polyfills Roll back some changes involved in separating UIEvent for dom and ios Test combined dts-es will now use lib, while internally we will not to avoid UIEvent conflict with dom stuff
19 lines
786 B
TypeScript
19 lines
786 B
TypeScript
import segmentedBarModule = require("ui/segmented-bar");
|
|
|
|
export function getNativeItemsCount(bar: segmentedBarModule.SegmentedBar): number {
|
|
return (<UISegmentedControl>bar.ios).numberOfSegments;
|
|
}
|
|
|
|
export function checkNativeItemsTextColor(bar: segmentedBarModule.SegmentedBar): boolean {
|
|
var isValid = true;
|
|
|
|
var attrs = (<UISegmentedControl>bar.ios).titleTextAttributesForState(UIControlState.Normal);
|
|
isValid = bar.color && attrs && attrs.valueForKey(NSForegroundColorAttributeName) === bar.color.ios;
|
|
|
|
return isValid;
|
|
}
|
|
|
|
export function setNativeSelectedIndex(bar: segmentedBarModule.SegmentedBar, index: number): void {
|
|
bar.ios.selectedSegmentIndex = index;
|
|
(<UISegmentedControl>bar.ios).sendActionsForControlEvents(UIControlEvents.ValueChanged);
|
|
} |