How to show default image if url is empty in api response?.

DevMaranDevMaran Member ✭✭
edited August 2018 in Xamarin.Forms

Hi Developers, I am using FFImageLoading plugin to load images but I need to set default image when Image URL is empty in API response like:

"ClassAttendance": [
{
"StudentId": 1,
"StudentAttendanceId": 0,
"ReferenceNumber": "",
"AdmissionNumber": "1234",
"FirstName": "test",
"LastName": "test",
"MiddleName": "",
"OtherNames": "test",
"ProfilePicture": "",
"OriginalPicFileName": null,
"GenderLookupId": 0,
"FatherName": null,
"MotherName": null,
"FatherContactNumber": null,
"MotherContactNumber": null,
"CurrentClassID": 0,
"CurrentClass": null,
"CurrentSection": null,
"PicAsBase64": null,
"Present": true,
"DateAbsent": "0001-01-01T00:00:00",
"ReasonSubmitted": false,
"Reason": null
}
]

I have tried:

Best Answer

Answers

  • DevMaranDevMaran Member ✭✭

    @ManojkumarMali Thanks for the quick reply but I am looking for the solution in FFImageLoading Plugin. Your answer is also worked but I need to do looping of the list to get "PicAsBase64". Please let me know if you have a better suggestion on this.

Sign In or Register to comment.