Strange white gray foreground on some Android 9 phones

I have some really strange behavior on Xamarin Forms app on some devices. Everything works on iOS, all android < 9.0 and on some of android devices >= 9.0. You can see it here: https://www.dropbox.com/s/ymhak5zv0jv3awa/VID_20190304_162939.mp4?dl=0

On some Android 9 devices first form is shown well, login is fine, base page is shown. But the user has to setup the profile when logged first time, and when the profile page is opened some strange white gray foreground (with some transparency, since I can barely see the button under) and it doesn't respond to tap on the button below it. Some of the app users reported this and everything works fine on android 9 emulators. I'm still trying to debug it on the real device with this behavior, but I'm wondering if anyone had a problem like this. This is just too hard to google it as I can't describe the problem well to google it.

I updated all controls to the last ones, I even moved from PCL to .NETStandard and I don't use modal dialogs anymore, but nothing helped so far.

This is the code I can share so far:

When the base page appears, it checks if it's the first time start and pushes the profile page:
if (firstTime) await App.Navigation.PushAsync(page, animated);

This code is called at the end of BasePage's OnAppearing()

UserProfilePage looks like this:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="PickApp.View.UserProfilePage"
             xmlns:ffimageloading="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms"
             xmlns:sub="clr-namespace:PickApp.ControlSubClasses"
             Style="{StaticResource DefaultPickBackground}"
         Padding="0, 20, 0, 0"
             NavigationPage.HasNavigationBar="False">
    <ContentPage.Content>
        <Grid BackgroundColor="#F5F5F5" RowSpacing="0" >
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="1*" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="1*" />
            </Grid.ColumnDefinitions>
            <ScrollView HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" 
                        Grid.Row="1" Grid.Column ="0" >
                <StackLayout Padding="0, 0, 0, 12" Spacing="0">
                    <StackLayout Spacing="0" Padding="0" >
                        <StackLayout Padding="0" Spacing="0" BackgroundColor="White" >
                            <RelativeLayout HeightRequest="160" VerticalOptions="Start" HorizontalOptions="FillAndExpand">
                                <ffimageloading:CachedImage
                            HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Aspect="AspectFill"
                            RelativeLayout.WidthConstraint="{ConstraintExpression
                            Type=RelativeToParent,Property=Width,Factor=1,Constant=0}"
                            RelativeLayout.HeightConstraint="{ConstraintExpression
                            Type=RelativeToParent,Property=Height,Factor=1,Constant=0}"
                            Source="{Binding UserDetailed.UserPhoto}" />
                                <StackLayout RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent,
                                Property=Width,Factor=1,Constant=-45}"
                                RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent,
                                Property=Height,Factor=1,Constant=-45}"
                                RelativeLayout.HeightConstraint="{ConstraintExpression
                                Type=RelativeToParent,Property=Height,Factor=0,Constant=45}"
                                RelativeLayout.WidthConstraint="{ConstraintExpression
                                Type=RelativeToParent,Property=Width,Factor=0,Constant=45}" >
                                    <Image Source="shdUpload.png" HeightRequest="30" WidthRequest="30" HorizontalOptions="Center" VerticalOptions="CenterAndExpand" />
                                </StackLayout>
                                <StackLayout RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent,
                                Property=Width,Factor=1,Constant=-45}"
                                RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent,
                                Property=Height,Factor=1,Constant=-45}"
                                RelativeLayout.HeightConstraint="{ConstraintExpression
                                Type=RelativeToParent,Property=Height,Factor=0,Constant=45}"
                                RelativeLayout.WidthConstraint="{ConstraintExpression
                                Type=RelativeToParent,Property=Width,Factor=0,Constant=45}" >
                                    <Image Source="cmdUpload.png" x:Name="uploadImage" HeightRequest="15" WidthRequest="15" HorizontalOptions="Center" VerticalOptions="CenterAndExpand" />
                                    <StackLayout.GestureRecognizers>
                                        <TapGestureRecognizer Command="{Binding PhotoUploadTapped}" />
                                    </StackLayout.GestureRecognizers>
                                </StackLayout>
                            </RelativeLayout>
                            <Grid BackgroundColor="White" Padding="20, 20, 20, 20" Margin="0, 0, 0, 0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="1*" />
                                    <ColumnDefinition Width="1*" />
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                </Grid.RowDefinitions>
                                <Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" FontSize="14" Text="{Binding NameLabel}" TextColor="#CCCCCC" FontAttributes="Bold" VerticalOptions="CenterAndExpand" VerticalTextAlignment="Center" />
                                <sub:SubRegEntry Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Text="{Binding UserDetailed.UserName, Mode=TwoWay}" Margin="-4, 0" BackgroundColor="White" TextColor="#7F7F7F" HorizontalOptions="FillAndExpand" BorderColor="#CCCCCC" PadLeft="8" TextChanged="UserNameChanged" InputType="Name" />
                                <Label Grid.Row="2" Grid.Column="0" Text="{Binding GenderLabel}" FontSize="14" TextColor="#CCCCCC" FontAttributes="Bold" />
                                <sub:SubPicker Grid.Row="3" Grid.Column="0" ItemsSource="{Binding Genders}" SelectedItem="{Binding UserDetailed.GenderObj}" ItemDisplayBinding="{Binding GenderStr}" HorizontalOptions="StartAndExpand" VerticalOptions="Center" BackgroundColor="#FFFFEB" HeightRequest="30" FontSize="17" TextColor="#7F7F7F" SelectedIndexChanged="AnythingChanged" />
                                <Label Grid.Row="2" Grid.Column="1" Text="{Binding YearOfBirthLabel}" FontSize="14" TextColor="#CCCCCC" FontAttributes="Bold" />
                                <sub:SubPicker Grid.Row="3" Grid.Column="1" ItemsSource="{Binding YearArray}" SelectedItem="{Binding UserDetailed.UserBorn}" HorizontalOptions="StartAndExpand" VerticalOptions="Center" BackgroundColor="#FFFFEB" HeightRequest="30" FontSize="17" TextColor="#7F7F7F" SelectedIndexChanged="AnythingChanged" />
                                <Label Grid.Row="4" Grid.Column="0" Text="{Binding CityLabel}" FontSize="14" TextColor="#CCCCCC" FontAttributes="Bold" Margin="0, 10, 0, 0" VerticalOptions="CenterAndExpand" VerticalTextAlignment="Center" />
                                <sub:SubPicker Grid.Row="5" Grid.Column="0" ItemsSource="{Binding Cities}" SelectedItem="{Binding UserDetailed.CityObj}" ItemDisplayBinding="{Binding CityName}" HorizontalOptions="StartAndExpand" VerticalOptions="Center" BackgroundColor="#FFFFEB" HeightRequest="30" FontSize="17" TextColor="#7F7F7F" SelectedIndexChanged="AnythingChanged" />
                                <Label Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="2" Text="{Binding PhoneLabel}" FontSize="14" TextColor="#CCCCCC" FontAttributes="Bold" Margin="0, 10, 0, 0" VerticalOptions="CenterAndExpand" VerticalTextAlignment="Center" />
                                <sub:SubRegEntry x:Name="phoneEntry" Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="2" Text="{Binding UserDetailed.UserPhone, Mode=TwoWay}" Margin="-4, 0" BackgroundColor="White" TextColor="#7F7F7F" HorizontalOptions="FillAndExpand" BorderColor="#CCCCCC" PadLeft="8" Keyboard="Telephone" TextChanged="AnythingChanged" InputType="Telephone" />
                            </Grid>
                        </StackLayout>
                        <sub:MyShadowFrame HeightRequest="3" Padding="0" Margin="0" />
                    </StackLayout>
                    <Grid ColumnSpacing="0" HeightRequest="{Binding FitInjuredHeightRequest}" Margin="0,10" >
                        <Grid.RowDefinitions>
                            <RowDefinition Height="85" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="1*" />
                            <ColumnDefinition Width="1*" />
                        </Grid.ColumnDefinitions>
                        <Frame Grid.Row="0" Grid.Column="0"  HorizontalOptions="FillAndExpand" HasShadow="False" BackgroundColor="{Binding FitBackgroundColor}" Margin="20,20,-0.5,20" Padding="10,8" BorderColor="#CCCCCC" >
                            <Frame.GestureRecognizers>
                                <TapGestureRecognizer Command="{Binding FitTapped}">
                                </TapGestureRecognizer>
                            </Frame.GestureRecognizers>
                            <StackLayout Orientation="Horizontal" >
                                <Image Source="{Binding FitImage}" HorizontalOptions="Start" VerticalOptions="CenterAndExpand" Aspect="AspectFit" Opacity="{Binding FitOpacity}" Margin="7" HeightRequest="15" />
                                <Label Text="{Binding FitLabel}" FontSize="14" FontAttributes="Bold" HorizontalOptions="StartAndExpand" VerticalOptions="CenterAndExpand" TextColor="{Binding FitColor}" />
                            </StackLayout>
                        </Frame>
                        <Frame Grid.Row="0" Grid.Column="1" HorizontalOptions="FillAndExpand" HasShadow="False" BackgroundColor="{Binding InjuredBackgroundColor}" Margin="-0.5,20,20,20" Padding="10,8" BorderColor="#CCCCCC" >
                            <Frame.GestureRecognizers>
                                <TapGestureRecognizer Command="{Binding InjuredTapped}">
                                </TapGestureRecognizer>
                            </Frame.GestureRecognizers>
                            <StackLayout Orientation="Horizontal" >
                                <Image Source="{Binding InjuredImage}" HorizontalOptions="Start" VerticalOptions="CenterAndExpand" Aspect="AspectFit" Opacity="{Binding InjuredOpacity}" Margin="7" HeightRequest="15" />
                                <Label Text="{Binding InjuredLabel}" FontSize="14" FontAttributes="Bold" HorizontalOptions="StartAndExpand" VerticalOptions="CenterAndExpand" TextColor="{Binding InjuredColor}" />
                            </StackLayout>
                        </Frame>
                    </Grid>
                    <Frame Grid.Row="0" Grid.Column="0"  HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand" HasShadow="False" BackgroundColor="{Binding ContinueBackgroundColor}" BorderColor="{Binding ContinueBorderColor}" Margin="0,20,0,20" Padding="10,8,40,8" HeightRequest="{Binding SaveButtonHeightRequest}" IsVisible="{Binding IsLight}" >
                        <Frame.GestureRecognizers>
                            <TapGestureRecognizer Command="{Binding ContinueTapped}">
                            </TapGestureRecognizer>
                        </Frame.GestureRecognizers>
                        <StackLayout Orientation="Horizontal" >
                            <Image Source="{Binding ContinueImage}" HorizontalOptions="Start" VerticalOptions="CenterAndExpand" Opacity="{Binding ContinueOpacity}" Margin="7" HeightRequest="15" />
                            <Label Text="{Binding ContinueLabel}" FontSize="14" FontAttributes="Bold" HorizontalOptions="StartAndExpand" VerticalOptions="CenterAndExpand" TextColor="{Binding ContinueTextColor}" />
                        </StackLayout>
                    </Frame>
                </StackLayout>
            </ScrollView>
            <sub:MyFrame HasShadow="True" BorderColor="Transparent" Margin="0, -20, 0, 0" Padding="0" CornerRadius="0"
                         Grid.Row="0" Grid.Column="0">
                <StackLayout x:Name="topLayout" Spacing="0" Padding="0, 20, 0, 0" BackgroundColor="#8CEB8C" >
                    <Grid Padding="0" IsVisible="{Binding IsFull}" >
                        <Grid.RowDefinitions>
                            <RowDefinition Height="50" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <StackLayout Grid.Row="0" Grid.Column="0" Margin="10, 0, 0, 0" Padding="10, 13.75" VerticalOptions="StartAndExpand" >
                            <Image Source="menBack.png" Aspect="AspectFit" Margin="0" HeightRequest="22.5" VerticalOptions="CenterAndExpand" />
                            <StackLayout.GestureRecognizers>
                                <TapGestureRecognizer Command="{Binding BackTapped}" />
                            </StackLayout.GestureRecognizers>
                        </StackLayout>
                        <StackLayout Grid.Row="0" Grid.Column="1" Padding="10, 13.75" VerticalOptions="FillAndExpand" >
                            <Image Source="menSave.png" Aspect="AspectFit" Margin="0" IsEnabled="{Binding SaveEnabled}" Opacity="{Binding SaveOpacity}" IsVisible="{Binding SchemaDetailed.AllowEdit}" HeightRequest="22.5" VerticalOptions="CenterAndExpand" />
                            <StackLayout.GestureRecognizers>
                                <TapGestureRecognizer Command="{Binding SaveTapped}" />
                            </StackLayout.GestureRecognizers>
                        </StackLayout>
                    </Grid>
                </StackLayout>
            </sub:MyFrame>
        </Grid>
    </ContentPage.Content>
</ContentPage>

I'll try to upload some test project as soon as I isolate the problem on the device with the problem, but I didn't have such a device in my hands.

Answers

  • yelinzhyelinzh Member, Xamarin Team Xamurai

    I have an android 9 device and I'll try to reproduce the project after you uploaded the project.

  • ivanxamarinivanxamarin Member ✭✭

    @yelinzh
    Thanks a lot. I can't upload the whole project. I'll try to isolate the problem and upload a small one with the same problem. Although you could try installing the app from https://play.google.com/store/apps/details?id=com.pickedtobe.pick&hl=en if it's available in your country. I hope this is not going to be understood as advertising since the app is just in one language at this point.

  • yelinzhyelinzh Member, Xamarin Team Xamurai

    Sorry , I failed to install the app.

Sign In or Register to comment.