Created
September 7, 2014 12:30
-
-
Save RodH257/142314f2c60afca4b2de to your computer and use it in GitHub Desktop.
Referencing full image path in Xamarin iOS apps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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