mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 03:31:45 +08:00
apps updated
This commit is contained in:
@ -1,17 +1,18 @@
|
||||
var obj;
|
||||
|
||||
export function loaded(args) {
|
||||
obj = args.object;
|
||||
}
|
||||
import view = require("ui/core/view");
|
||||
import observable = require("data/observable");
|
||||
import label = require("ui/label");
|
||||
|
||||
export function butonTap(args) {
|
||||
if (obj.style.textDecoration === "underline") {
|
||||
obj.style.textDecoration = "line-through";
|
||||
} else if (obj.style.textDecoration === "line-through") {
|
||||
obj.style.textDecoration = "line-through underline";
|
||||
} else if (obj.style.textDecoration === "line-through underline") {
|
||||
obj.style.textDecoration = "none";
|
||||
} else if (obj.style.textDecoration === "none") {
|
||||
obj.style.textDecoration = "underline";
|
||||
var btn = <view.View>args.object;
|
||||
var lbl = <label.Label>btn.parent.getViewById("Label1");
|
||||
|
||||
if (lbl.style.textDecoration === "underline") {
|
||||
lbl.style.textDecoration = "line-through";
|
||||
} else if (lbl.style.textDecoration === "line-through") {
|
||||
lbl.style.textDecoration = "line-through underline";
|
||||
} else if (lbl.style.textDecoration === "line-through underline") {
|
||||
lbl.style.textDecoration = "none";
|
||||
} else if (lbl.style.textDecoration === "none") {
|
||||
lbl.style.textDecoration = "underline";
|
||||
}
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
<ScrollView>
|
||||
<StackLayout>
|
||||
<Button text="Change" tap="butonTap" />
|
||||
<Label text="Text" style.textDecoration="underline" loaded="loaded"/>
|
||||
<Label id="Label1" text="Text" style.textDecoration="underline" />
|
||||
|
||||
<Label text="Label" style="text-decoration:none" />
|
||||
<Label text="Label" style="text-decoration:underline" />
|
||||
|
@ -1,13 +1,14 @@
|
||||
var obj;
|
||||
import view = require("ui/core/view");
|
||||
import observable = require("data/observable");
|
||||
import label = require("ui/label");
|
||||
|
||||
export function loaded(args) {
|
||||
obj = args.object;
|
||||
}
|
||||
export function butonTap(args: observable.EventData) {
|
||||
var btn = <view.View>args.object;
|
||||
var lbl = <label.Label>btn.parent.getViewById("Label1");
|
||||
|
||||
export function butonTap(args) {
|
||||
if (obj.style.whiteSpace === "normal") {
|
||||
obj.style.whiteSpace = "nowrap";
|
||||
} else if (obj.style.whiteSpace === "nowrap") {
|
||||
obj.style.whiteSpace = "normal";
|
||||
if (lbl.style.whiteSpace === "normal") {
|
||||
lbl.style.whiteSpace = "nowrap";
|
||||
} else if (lbl.style.whiteSpace === "nowrap") {
|
||||
lbl.style.whiteSpace = "normal";
|
||||
}
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
<ScrollView>
|
||||
<StackLayout width="50">
|
||||
<Button text="Change" tap="butonTap" />
|
||||
<Label text="Text Text" style.whiteSpace="normal" loaded="loaded"/>
|
||||
<Label id="Label1" text="Text Text" style.whiteSpace="normal" />
|
||||
|
||||
<Label text="Label Normal" style="white-space:normal" />
|
||||
<Label text="Label Nowrap" style="white-space:nowrap" />
|
||||
|
Reference in New Issue
Block a user