mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 03:31:45 +08:00
Merge pull request #3110 from NativeScript/vchimev-flexbox
Update flexbox css test page
This commit is contained in:
@ -1,13 +0,0 @@
|
|||||||
#container {
|
|
||||||
border-color: black;
|
|
||||||
border-width: 1;
|
|
||||||
margin: 5;
|
|
||||||
}
|
|
||||||
#container>Label {
|
|
||||||
border-width: 2;
|
|
||||||
border-color: black;
|
|
||||||
border-radius: 5;
|
|
||||||
}
|
|
||||||
#container>Label[selected="yes"] {
|
|
||||||
border-color: gray;
|
|
||||||
}
|
|
@ -1,21 +1,20 @@
|
|||||||
|
export function resetStyles(args) {
|
||||||
|
args.object.page.css = "#container { border-color: black; border-width: 1; margin: 5; } #container>Label { border-width: 2; border-color: black; border-radius: 5; }";
|
||||||
|
}
|
||||||
|
|
||||||
export const flexFlow = applyCss();
|
export const flexFlow = applyCss();
|
||||||
|
|
||||||
function applyCss() {
|
function applyCss() {
|
||||||
return function(args) {
|
return function(args) {
|
||||||
// args.object.page.getViewById("container")[what] = args.object.text;
|
|
||||||
let boxCss = " #container { " + args.object.tag + " }" ;
|
let boxCss = " #container { " + args.object.tag + " }" ;
|
||||||
// console.log(boxCss);
|
// console.log(boxCss);
|
||||||
args.object.page.addCss(boxCss);
|
args.object.page.addCss(boxCss);
|
||||||
console.log(args.object.page.css);
|
// console.log(args.object.page.css);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function applyStyles(args) {
|
export function applyStyles(args) {
|
||||||
// var css = "#test-element { " + args.object.tag + " }";
|
resetStyles(args);
|
||||||
console.log(args.object.tag);
|
// console.log(args.object.tag);
|
||||||
args.object.page.addCss(args.object.tag);
|
args.object.page.addCss(args.object.tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function resetTap(args) {
|
|
||||||
args.object.page.css = "";
|
|
||||||
}
|
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
<Page xmlns="http://schemas.nativescript.org/tns.xsd" android:actionBarHidden="true" loaded="onLoaded">
|
<Page xmlns="http://schemas.nativescript.org/tns.xsd" android:actionBarHidden="true" loaded="resetStyles">
|
||||||
<GridLayout rows="200, *">
|
<GridLayout rows="200, *">
|
||||||
<FlexboxLayout style="flex-wrap: wrap;">
|
<FlexboxLayout style="flex-wrap: wrap;">
|
||||||
|
|
||||||
|
<Button text="r" tap="resetStyles" automationText="reset" />
|
||||||
|
|
||||||
<!--container-->
|
<!--container-->
|
||||||
<Button text="f" tag="flex-flow: row-reverse wrap-reverse;" tap="flexFlow" automationText="flexFlow" />
|
<Button text="f" tag="flex-flow: row-reverse wrap-reverse;" tap="flexFlow" automationText="flexFlow" />
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user