Floating button in vanilla Nativescript(Core Nativescript)


#1

Hi All,
I have successfully implemented floating button in NS-core.You can try like this

XML:
<Page>
<AbsoluteLayout>
<ScrollView>
//Here goes your page layouts which is scrollable
</ScrollView>
<StackLayout>
//Here goes the styles for your non-scrollable content.
</StackLayout>
</AbsoluteLayout>
<Page>

Thanks.


#2

also you can use this plugin https://github.com/bradmartin/nativescript-floatingactionbutton
where in Android it wrap native FloatingActionButton widget


#3

Yay, I looked into it previously but I thought when we can implement our own no need to go for the plugin. :slight_smile:


#4

Definitely a good option to do it yourself :smile: the only “benefit” IMO to using the plugin or the native widget is the native material effects you get on Android (ripple, shadow, click noise, etc.) However, that can definitely be done without the plugin just by taking the plugin source also and making your own by calling the android APIs from your app.


#5

Agreed sir, but I jus wanted a button which is clickable and not scrollable with the view so I went by my method.