We have a PCL Xamarin.Forms project with some XAML.
Images are project-specific so we put the image in the starting projec (i.e. Wp and Android)
We want to define image name in the XAML so we use:
x:Name="myImage" Source="NavigationLeft.png"
Android takes the "NavigationLeft.png" in the Resources/Drawable
WindowsPhone takes the "NavigationLeft.png" on the root of the project.
So Windows phone project get messed with resource images in the root folder.
Is there a way to avoid this?
No, there's not: in Windows Phone we could place the image in an "Images" forder and reference it with "Images/NavigationLeft.png" in XAML, this would work.
But in Android the Resource/drawable directory is a flat diretory and does allow subdirs.
For now i prefixed share image with an x "xNavigationLeft".
Sources:
Android drawable does not allow subdirs
For Wp using Xamarin.Forms we must put images on root dir
Images are project-specific so we put the image in the starting projec (i.e. Wp and Android)
We want to define image name in the XAML so we use:
x:Name="myImage" Source="NavigationLeft.png"
Android takes the "NavigationLeft.png" in the Resources/Drawable
WindowsPhone takes the "NavigationLeft.png" on the root of the project.
So Windows phone project get messed with resource images in the root folder.
Is there a way to avoid this?
No, there's not: in Windows Phone we could place the image in an "Images" forder and reference it with "Images/NavigationLeft.png" in XAML, this would work.
But in Android the Resource/drawable directory is a flat diretory and does allow subdirs.
For now i prefixed share image with an x "xNavigationLeft".
Sources:
Android drawable does not allow subdirs
For Wp using Xamarin.Forms we must put images on root dir
Commenti