Adding bottom and right properties on AbsoluteLayout


#1

Hello,

I started developping with NativeScript about 2 hours ago (I must say that I come from Ionic) and I wanted to add a “floating button” at the bottom right edge of the screen, no matter what the device dimension (like Snapchat).

I looked for a good solution but I didn’t find it. In fact I want to be able to position my button wherever I want. So I used a AbsoluteLayout, and I wanted to use the css properties “right” and “bottom”, like “top” and “left”… but I couldn’t ; there’re not recognized…

Is there a different way of doing this? Am I missing something?

Thanks a lot :-).


#2

Hey @AdrianPal, and welcome to NativeScript!

Unless you want to reinvent the wheel, you should consider downloading and using a readily-available solution - the nativescript-floatingactionbutton (FAB) - https://github.com/bradmartin/nativescript-floatingactionbutton

For more amazing plugins make sure to visit https://market.nativescript.org/


#3

Thanks ! But can we position the button wherever I want on the screen ?


#4

And why can’t we use the « right » and « bottom » properties?


#5

The right and bottom css properties are not supported, but you have the option of positioning the FAB on any of the 4 corners of the screen.