【发布时间】:2019-06-16 17:40:06
【问题描述】:
我正在使用 Nativescript Vue 并尝试通过 Nativescript-Gesture Rotation 旋转 TextView 标记中的文本。文字会旋转,但不流畅,会从一个方向跳到另一个方向。这就是我的问题
为什么会这样? NS-Gesture Rotation 表现如此奇怪的原因是什么?以及如何让它发挥作用?
我将在此处和NS Playground 中发布我的示例示例。
<template>
<Page class="page">
<ActionBar title="Home" class="action-bar" />
<StackLayout class="home-panel">
<TextView @rotation="onRotation" id="liveLabel" textWrap="true"
:rotate="textRotation" editable="false">
<FormattedString id="formString">
<Span id="spanText" text="Test text" fontSize="20"
color="red" />
</FormattedString>
</TextView>
</StackLayout>
</Page>
</template>
<script>
export default {
data() {
return {
textRotation: 0
};
},
methods: {
onRotation(args) {
console.log(
"Rotate angle: " + args.rotation + " state: " + args.state
);
this.textRotation = Math.floor(args.rotation);
}
}
};
</script>
【问题讨论】:
标签: nativescript nativescript-vue