triniwiz / nativescript-popup

Apache License 2.0
22 stars 17 forks source link

Shadow in Android using setElevation #2

Closed aboganas closed 6 years ago

aboganas commented 6 years ago

I have tried to add shadow to Android part by using setElevation() which should provide shadowing for the Popwindow if the background is set and API >=21, but sill have no luck with that. when I tried

this._popup.setElevation(10);

it says that setElevation is not a property, and when I try to do it to the view

view.android.setElevation(10);

nothing happens

shiv19 commented 6 years ago

You'll have to set the background to a drawable before you can use set elevation

aboganas commented 6 years ago

ok I tried with this._popup.setBackgroundDrawable(new android.graphics.drawable.ColorDrawable(new Color(this._options.backgroundColor).android)); correction: it also worked without adding above code, just using the background set originally

; however, I still get the following error ../node_modules/nativescript-popup/popup.android.ts(104,21): error TS2339: Property 'setElevation' does not exist on type 'PopupWindow'. even-though it works

shiv19 commented 6 years ago

that's strange. not sure why

triniwiz commented 6 years ago

@aboganas it should be fixed for you now :)