mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(ios): backgroundColor property on Button (#9524)
closes NativeScript/NativeScript#9523
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import { ControlStateChangeListener } from '../core/control-state-change';
|
||||
import { ButtonBase } from './button-common';
|
||||
import { View, PseudoClassHandler } from '../core/view';
|
||||
import { borderTopWidthProperty, borderRightWidthProperty, borderBottomWidthProperty, borderLeftWidthProperty, paddingLeftProperty, paddingTopProperty, paddingRightProperty, paddingBottomProperty } from '../styling/style-properties';
|
||||
import { backgroundColorProperty, borderTopWidthProperty, borderRightWidthProperty, borderBottomWidthProperty, borderLeftWidthProperty, paddingLeftProperty, paddingTopProperty, paddingRightProperty, paddingBottomProperty } from '../styling/style-properties';
|
||||
import { textAlignmentProperty, whiteSpaceProperty } from '../text-base';
|
||||
import { layout } from '../../utils';
|
||||
import { CoreTypes } from '../../core-types';
|
||||
import { Color } from '../../color';
|
||||
|
||||
export * from './button-common';
|
||||
|
||||
@@ -56,6 +57,14 @@ export class Button extends ButtonBase {
|
||||
}
|
||||
}
|
||||
|
||||
[backgroundColorProperty.getDefault](): UIColor {
|
||||
return this.nativeViewProtected.backgroundColor;
|
||||
}
|
||||
|
||||
[backgroundColorProperty.setNative](value: UIColor | Color) {
|
||||
this.nativeViewProtected.backgroundColor = value instanceof Color ? value.ios : value;
|
||||
}
|
||||
|
||||
[borderTopWidthProperty.getDefault](): CoreTypes.LengthType {
|
||||
return {
|
||||
value: this.nativeViewProtected.contentEdgeInsets.top,
|
||||
|
||||
Reference in New Issue
Block a user