Reputation: 29
I made app from Visual studio Xamarin.Forms Shell template. I added local images to android(drawable folders) and iOS project (assets catalog). In Android is everything OK. But in iOS project is image visible only in iPhone simulator. Image does not show on real device (iPhone). And I don´t know where is problem. I am using Xamarin.Form 4.8
Item detail page with included image.
<StackLayout Spacing="20" Padding="15">
<Image Source="baseline_home_black_48.png" HeightRequest="100" WidthRequest="100"></Image>
<Image Source="baseline_home_black_48" HeightRequest="100" WidthRequest="100"></Image>
...
</StackLayout>
Upvotes: 1
Views: 1188
Reputation: 601
Short answer: You need to connect the iPhone/iPad direct to the MacBook for debugging.
--
Long answer: There are two ways to debug a Xamarin Forms iOS app:
"Limitations Asset Catalogs are currently not supported. When using Hot Restart, your app will show the default icon and launch screen for Xamarin apps. When paired to a Mac, or developing on a Mac, your Asset Catalogs will work."
from Xamarin Hot Restart
Remember that you need to allow trust access in the iPhone and enable Developer mode at Settings > Privacy and Security > Developer Mode > Enable. If the developer mode is not shown, you need to connect the cable first.
Upvotes: 0
Reputation: 1
HI In my case I was using two different systems to build the application. The image names contains - instead of _ once I correct it and include in the project it worked for me.
Have a great day.
Upvotes: 0
Reputation: 133
We had this issue and spent (wasted?) a few hours looking in to this.
Images were not appearing on real iOS devices (in debug) but were working fine for simulators. Local and remote images resulted in the same issue.
The issue appears to be a project setting.
Removal of --interpreter from the 'Additional mtouch arguments:' field seems to get it working. We believe the checkbox 'Enable the Mono interpreter' means the same thing and when checked images should still work and hot-reload too.
Upvotes: 1