Closed dimitriospafos closed 4 years ago
Hi @dimitriospafos, You cannot pass image as string. You need to pass it as a resource.
You can use the following code;
var app = require("tns-core-modules/application");
var context = app.android.context;
var image = "@drawable/image"; //Place image name without extension. //Image should be placed in "~App_Resources\Android\src\main\res\drawable-xxx"
var resId = context.getResources().getIdentifier(image,null, context.getPackageName());
@Rahul1d thanks this worked.
How do I pass the "contentImage?" argument in showColorDialog?
showColorDialog( title: string, subTitle: string, okBtnTitle?: string, cancelBtnTitle?: string, backgroundColor?: string, titleTextColor?: string, contextTextColor?: string, contentImage?: any ): Promise;
I tried to pass the name of an image which exists in assets ? (e,g image.png) but it didn't work.