[mono-android] Drawables with a space in the filename?
Jonathan Pryor
jonp at xamarin.com
Thu Jan 19 02:40:53 UTC 2012
On Jan 18, 2012, at 6:07 PM, Tossing, Chris wrote:
> Is it possible to use drawables with spaces in the filename? I have an image library that I would prefer to use as it is (has spaces in the filenames).
You will need to map it to a filename that doesn't contain a space. This doesn't require renaming the file. :-)
Due to the wonders of MSBuild, the <Link/> element can be used to "rename" files, so you could have:
<ItemGroup>
<AndroidResource Include="Resources\Layouts\With Spaces.axml">
<Link>Resources\Layouts\WithoutSpaces.axml</Link>
</AndroidResource>
</ItemGroup>
At least, this should work; it works for <AndroidAsset/> [0]!
This does mean that when you reference the file via the `Resources` type, you'll be using the <Link/>d name, not the "real" filename.
- Jon
[0] https://github.com/xamarin/monodroid-samples/blob/master/SanityTests/SanityTests.csproj#L73
More information about the Monodroid
mailing list