Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Referencing full image path in Xamarin iOS apps
public static class GetFullImagePath
{
public static string ForFileName (string fileName)
{
//Any old images with a full file path stored should have the front part removed
if (fileName.Contains ("/"))
{
fileName = fileName.Substring (fileName.LastIndexOf ("/") + 1);
}
var docsDir = Environment.GetFolderPath (Environment.SpecialFolder.Personal);
return System.IO.Path.Combine (docsDir, fileName);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment