在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):nstudio/nativescript-floatingactionbutton开源软件地址(OpenSource Url):https://github.com/nstudio/nativescript-floatingactionbutton开源编程语言(OpenSource Language):TypeScript 88.7%开源软件介绍(OpenSource Introduction):NativeScript-FloatingActionButtonNativeScript plugin for Material Design Floating Action Button UI component.InstallationNativescript 7+:
NativeScript lower than 7:
ScreenshotMultiple FAB/Swipe Animation SupportUsageThe icon for the FAB can be a local image in your app or an image/icon from the App_Resources.Plain NativeScript<Page xmlns="http://schemas.nativescript.org/tns.xsd" loaded="pageLoaded"
xmlns:FAB="@nstudio/nativescript-floatingactionbutton">
<ActionBar title="Native FAB" />
<grid-layout rows="auto, *">
<list-view row="1" items="{{ users }}">
<list-view.itemTemplate>
<label text="{{ name }}" />
</list-view.itemTemplate>
</list-view>
<FAB:fab tap="fabTap"
row="1"
icon="'~/assets/ic_add_white.png'"
rippleColor="#f1f1f1"
class="fab-button" />
</grid-layout>
</Page> NativeScript Angularimport { registerElement } from 'nativescript-angular/element-registry';
registerElement(
'Fab',
() => require('@nstudio/nativescript-floatingactionbutton').Fab
); HTML<StackLayout>
<FAB (tap)="fabTap()" icon="~/assets/ic_add_white.png" rippleColor="#f1f1f1" class="fab-button"></FAB>
</StackLayout> NativeScript Vueimport Vue from 'nativescript-vue';
Vue.registerElement(
'Fab',
() => require('@nstudio/nativescript-floatingactionbutton').Fab
); Template<template>
<page>
<grid-layout rows="auto, *">
<list-view row="1" items="{{ users }}">
<list-view.itemTemplate>
<label text="{{ name }}" textWrap="true" />
</list-view.itemTemplate>
</list-view>
<fab
@tap="fabTap"
row="1"
icon="res://ic_add_white"
rippleColor="#f1f1f1"
class="fab-button"
></fab>
</grid-layout>
</page>
</template> CSSRecommended CSS styles. .fab-button {
height: 70;
width: 70; /// this is required on iOS - Android does not require width so you might need to adjust styles
margin: 15;
background-color: #ff4081;
horizontal-align: right;
vertical-align: bottom;
} Use Icon FontsFirst you need to setup icon fonts as described in NativeScript documentation. After this, you can use icon fonts on FAB by specifiying the unicode as text and add the
API
iOS Notes
Running Demo Appsnpm run demo.android
// or
npm run demo.ios ChangelogContributors
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论