Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is xassets for IOS supported? #32

Open
AlexSchuetz opened this issue Oct 24, 2019 · 0 comments
Open

Is xassets for IOS supported? #32

AlexSchuetz opened this issue Oct 24, 2019 · 0 comments

Comments

@AlexSchuetz
Copy link

Is it possible to add IOS xassets to dll targeting ios?

I am building kind of a base app dll, which contains about everything that is needed for the app.
The only thing that differs between multiple app that are build with this is some configuration and really few app specific implementations.

At the moment I have to but the richt xassets in every app-project, which is a lot of copy and paste and of course error prone.

I tried to add xassets to the ios.dll by editing the csproj-file:

<ItemGroup Condition=" $(TargetFramework.StartsWith('Xamarin.iOS')) ">
   ....
    <ImageAsset Include="Assets.xcassets\ic_attachment.imageset\Contents.json">
      <Visible>false</Visible>
    </ImageAsset>
    <ImageAsset Include="Assets.xcassets\ic_attachment.imageset\ic_attachment.png">
      <Visible>false</Visible>
    </ImageAsset>
    <ImageAsset Include="Assets.xcassets\ic_attachment.imageset\ic_attachment_2x.png">
      <Visible>false</Visible>
    </ImageAsset>
    <ImageAsset Include="Assets.xcassets\ic_attachment.imageset\ic_attachment_3x.png">
      <Visible>false</Visible>
    </ImageAsset>
</ItemGroup>

For android this works just fine:

<PropertyGroup Condition=" $(TargetFramework.StartsWith('MonoAndroid')) ">
    <AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
  </PropertyGroup>
  <ItemGroup Condition=" $(TargetFramework.StartsWith('MonoAndroid')) ">
    ....
	<Compile Include="Resources\Resource.designer.cs" />
	<AndroidResource Include="Resources\drawable\*" />
  </ItemGroup>

I am accessing the images in xaml inside the library:

<Image Source="ic_attachment" ... />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant