mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-19 14:20:22 +08:00
33 lines
1.3 KiB
TypeScript
33 lines
1.3 KiB
TypeScript
import * as stack from "tns-core-modules/ui/layouts/stack-layout";
|
|
import * as view from "tns-core-modules/ui/core/view";
|
|
import { unsetValue } from "tns-core-modules/ui/core/view";
|
|
|
|
export function resetStyles(args) {
|
|
var stackLayout = <stack.StackLayout>args.object.parent.parent;
|
|
view.eachDescendant(stackLayout, function (v: view.View) {
|
|
v.style.fontFamily = unsetValue;
|
|
v.style.fontSize = unsetValue;
|
|
v.style.fontStyle = unsetValue;
|
|
v.style.fontWeight = unsetValue;
|
|
v.style.color = unsetValue;
|
|
v.style.textAlignment = unsetValue;
|
|
v.style.paddingLeft = unsetValue;
|
|
v.style.paddingRight = unsetValue;
|
|
v.style.paddingTop = unsetValue;
|
|
v.style.paddingBottom = unsetValue;
|
|
v.style.borderTopColor = unsetValue;
|
|
v.style.borderRightColor = unsetValue;
|
|
v.style.borderBottomColor = unsetValue;
|
|
v.style.borderLeftColor = unsetValue;
|
|
v.style.borderTopWidth = unsetValue;
|
|
v.style.borderRightWidth = unsetValue;
|
|
v.style.borderBottomWidth = unsetValue;
|
|
v.style.borderLeftWidth = unsetValue;
|
|
v.style.borderTopLeftRadius = unsetValue;
|
|
v.style.borderTopRightRadius = unsetValue;
|
|
v.style.borderBottomRightRadius = unsetValue;
|
|
v.style.borderBottomLeftRadius = unsetValue;
|
|
return true;
|
|
});
|
|
}
|