npm i --save @nstudio/nativescript-label-marquee
- 版本:1.0.1
- GitHub: https://github.com/nstudio/nativescript-ui-kit
- NPM: https://npmjs.net.cn/package/%40nstudio%2Fnativescript-label-marquee
- 下载
- 昨天: 0
- 上周: 0
- 上个月: 0
@nstudio/nativescript-label-marquee
一个标签,当文本超出可用宽度时,可以滚动显示。
ns plugin add @nstudio/nativescript-label-marquee
用法
JavaScript/TypeScript
<Page xmlns="http://schemas.nativescript.org/tns.xsd"
xmlns:lm="@nstudio/nativescript-label-marquee">
<StackLayout>
<lm:LabelMarquee
text="Lorem Ipsum; this is a long string of text that will animate because it's longer than the width of the view."
fadeLength="150"
scrollDuration="20"></lm:LabelMarquee>
</StackLayout>
</Page>
labelize: boolean
关闭滚动以显示为常规Label
。fadeLength: number
(仅限 iOS) 滚动时两侧渐变文本的宽度。scrollDuration: number
(仅限 iOS) 滚动文本的速度,以秒为单位测量从开始到结束的滚动时间。
Angular
import { registerElement } from '@nativescript/angular';
import { LabelMarquee } from '@nstudio/nativescript-label-marquee';
registerElement('LabelMarquee', () => LabelMarquee);
在组件中的使用
<LabelMarquee
text="Lorem Ipsum; this is a long string of text that will animate because it's longer than the width of the view."
fadeLength="150"
scrollDuration="20">
</LabelMarquee>
许可
Apache License 版本 2.0