mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Trying to fix padding...
This commit is contained in:
27
apps/app/ui-tests-app/css/padding-and-border.ts
Normal file
27
apps/app/ui-tests-app/css/padding-and-border.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { EventData, View, TextBase } from "ui/text-base";
|
||||
import { LayoutBase } from "ui/layouts/layout-base";
|
||||
|
||||
let cssClassNames = [
|
||||
"",
|
||||
"padding",
|
||||
"border",
|
||||
"background-color",
|
||||
"padding border",
|
||||
"padding background-color",
|
||||
"border background-color",
|
||||
"padding border background-color"
|
||||
];
|
||||
|
||||
let currentIndex = 0;
|
||||
|
||||
export function onChangeCSS(args: EventData){
|
||||
let page = (<View>args.object).page;
|
||||
let container = <LayoutBase>page.getViewById<LayoutBase>("container");
|
||||
currentIndex++;
|
||||
let newClassName = cssClassNames[currentIndex % cssClassNames.length];
|
||||
for(let i = 0, length = container.getChildrenCount(); i < length; i++){
|
||||
let child = container.getChildAt(i);
|
||||
child.className = newClassName;
|
||||
}
|
||||
(<TextBase>page.getViewById<TextBase>("info")).text = newClassName || "none";
|
||||
}
|
||||
Reference in New Issue
Block a user