Skip to content

Instantly share code, notes, and snippets.

@RodH257
Created September 7, 2014 12:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RodH257/142314f2c60afca4b2de to your computer and use it in GitHub Desktop.
Save RodH257/142314f2c60afca4b2de to your computer and use it in GitHub Desktop.
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