Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Image not showing/crashing app on some devices

$
0
0
Hi,

I've made an APK of my application to deploy it on a friend's Android device. Everything goes well but one image DOESN'T show on his device and it DOES show on my device and other friend's one (with same APK source file, of course).

Bugging device: Galaxy Note 3 with Android 5.0
Working devices: Oneplus 3 with Android 8.0 & Samsung A3 with Android 6.0.1
Android project: MinTarget=4.0.3 & compiled with Android 8.0

The code looks like this:

[Grid HorizontalOptions="Fill" VerticalOptions="Fill"]
[Image Source="{Binding Source={x:Static resources:ImagesIndex.Background}}" Aspect="AspectFill" /]
[StackLayout Orientation="Vertical" HorizontalOptions="Fill" VerticalOptions="Fill" Margin="10" Padding="10" BackgroundColor="#AAFFFFFF"]
// some content
[/StackLayout]
[/Grid]

(I couldn't use normal marking on the forum so I replaced marks by [ ])

Just so you know, the "{x:Static resources:ImagesIndex.Background}}" syntax is used for every other images and there is no problem with them. It points to a string "background.jpg" and this background file is located under AndroidProject/Resources/drawable as AndroidResource.

I've made some other tries:
- Removing the « BackgroundColor="#AAFFFFFF" » from child StackLayout but no difference
- Expanding the Image with HorizontalOptions & VerticalOptions as "Fill" but no difference
- Finally, I went to call this image in the background of parent page with « BackgroundImage="{x:Static resources:ImagesIndex.Background}}" » and the app went to crash after splashscreen on each run

One more thing: This "Grid" code (shown above) works on the bugging phone with a ScrollView in place of the StackLayout, so could the StackLayout be the cause of troubles even if this explanation still doesn't tell me why app is crashing with BackgroundImage applied on the parent page (ContentPage)?

Thanks for reading.

Viewing all articles
Browse latest Browse all 204402


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>