mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
setStyle renamed to setInlineStyle
This commit is contained in:
@@ -613,13 +613,13 @@ export var testIsVisible = function () {
|
||||
});
|
||||
}
|
||||
|
||||
export var testSetStyle = function () {
|
||||
export var testSetInlineStyle = function () {
|
||||
var lbl = new label.Label();
|
||||
|
||||
var expectedColor = "#ff0000";
|
||||
var expectedBackgroundColor = "#ff0000";
|
||||
|
||||
lbl.setStyle(`color: ${expectedColor};background-color: ${expectedBackgroundColor};`);
|
||||
lbl.setInlineStyle(`color: ${expectedColor};background-color: ${expectedBackgroundColor};`);
|
||||
|
||||
helper.buildUIAndRunTest(lbl, function (views: Array<viewModule.View>) {
|
||||
TKUnit.assertEqual(lbl.color.hex, expectedColor);
|
||||
|
||||
@@ -923,7 +923,7 @@ export class View extends proxy.ProxyObject implements definition.View {
|
||||
return false;
|
||||
}
|
||||
|
||||
public setStyle(style: string): void {
|
||||
public setInlineStyle(style: string): void {
|
||||
if (!types.isString(style)) {
|
||||
throw new Error("Parameter should be valid CSS string!");
|
||||
}
|
||||
|
||||
2
ui/core/view.d.ts
vendored
2
ui/core/view.d.ts
vendored
@@ -360,7 +360,7 @@ declare module "ui/core/view" {
|
||||
* Sets in-line CSS string as style.
|
||||
* @param style - In-line CSS string.
|
||||
*/
|
||||
public setStyle(style: string) : void;
|
||||
public setInlineStyle(style: string) : void;
|
||||
|
||||
public getGestureObservers(type: gestures.GestureTypes): Array<gestures.GesturesObserver>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user