How to store the Local image path in sqlite or xml database in Xamrin.Forms

喜你入骨 提交于 2019-12-12 04:55:55

问题


I have given task to store the image path in database either xml schema or sqlite database.I am working on Xamarin.Forms PCL project. I am very confused with how to store image path in database.because in android image should be placed in Ressource/drawble,ios image placed in Resources folder. I read this xamarin.forms documentaion. But not getting how to get path and store in database. Please anyone provide any resources or example.


回答1:


Hope you have gone through this documentation and to distinguish between iOS and Android is also Given here in this documentation .

if (Device.OS == TargetPlatform.iOS) {
    // Save in sqlite with iOS path
}if (Device.OS == TargetPlatform.Android) {
    // Save in sqlite with Android path
}

Hope it helps.



来源:https://stackoverflow.com/questions/29667108/how-to-store-the-local-image-path-in-sqlite-or-xml-database-in-xamrin-forms

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!