Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Bug with Image Control on Android?

$
0
0

I have an Image control that I'm using on Android and iOS. In iOS the image appears with the correct orientation. On Android is displays sideways. The Image's source is bound to a property that returns a URL of the image's location.

Here is the code for the Image in Xaml:

<RelativeLayout HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
                                                        <Image x:Name="curImage" Aspect="AspectFill" VerticalOptions="FillAndExpand" Source="{Binding ImageLink}"
                                                                       RelativeLayout.XConstraint=
                                                                            "{ConstraintExpression Type=RelativeToParent, 
                                                                                                    Property=Width,
                                                                                                    Factor=0,
                                                                                                    Constant=0}"
                                                                         RelativeLayout.YConstraint=
                                                                             "{ConstraintExpression Type=RelativeToParent, 
                                                                                                    Property=Height,
                                                                                                    Factor=0,
                                                                                                    Constant=0}"
                                                                        RelativeLayout.WidthConstraint=
                                                                            "{ConstraintExpression Type=RelativeToParent, 
                                                                                                    Property=Width,
                                                                                                    Factor=1,
                                                                                                    Constant=0}"
                                                                        RelativeLayout.HeightConstraint=
                                                                            "{ConstraintExpression Type=RelativeToParent, 
                                                                                                    Property=Width,
                                                                                                    Factor=1,
                                                                                                    Constant=0}">
                                                            <Image.GestureRecognizers>
                                                                <TapGestureRecognizer Command="{DynamicResource vmViewPoll}" CommandParameter="{Binding Id}" />
                                                            </Image.GestureRecognizers>
                                                        </Image>
                                                        <controls:ExtendedLabel Text="{Binding Question}" HeightRequest="75" LineBreakMode="WordWrap" TextColor="White" Font="Bold" BackgroundColor="#98434342"
                                                                    RelativeLayout.WidthConstraint=
                                                                        "{ConstraintExpression Type=RelativeToParent, 
                                                                        Property=Width,
                                                                        Factor=1,
                                                                        Constant=0}"
                                                                    RelativeLayout.XConstraint=
                                                                        "{ConstraintExpression Type=RelativeToParent, 
                                                                        Property=Width,
                                                                        Factor=0,
                                                                        Constant=0}"
                                                                    RelativeLayout.YConstraint=
                                                                        "{ConstraintExpression Type=RelativeToView,
                                                                        ElementName=curImage,
                                                                        Property=Height,
                                                                        Factor=1,
                                                                        Constant=-75}" />
                                                    </RelativeLayout>

I have attached screenshots of how it renders in Android and iOS. Is this a bug, known issue or am I simply doing something wrong?

Thanks!!!


Viewing all articles
Browse latest Browse all 77050

Trending Articles



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