After upgrading to Xamarin.iOS Version: 11.12.0.4 (Visual Studio Enterprise) styles not working

DwightHydeDwightHyde USMember ✭✭

It appears that after I upgraded to Xamarin.iOS Version: 11.12.0.4 (Visual Studio Enterprise) the styles are not being applied any longer for iOS. Has anyone else experienced this? Here's some code that displays accordingly in Xamarin.iOS Version: 11.8.0.20 (Visual Studio Enterprise):

<?xml version="1.0" encoding="utf-8" ?>

<ContentPage.Resources>
    <ResourceDictionary>

        <Style x:Key="EntryStyle" TargetType="Entry" BasedOn="{StaticResource UchTextEntry}">
            <Setter Property="HorizontalOptions" Value="FillAndExpand" />
            <Setter Property="FontSize" Value="Medium"/>
            <Setter Property="TextColor" Value="{StaticResource UchRedColor}"/>
        </Style>

        <Style x:Key="StackBottomStyle" TargetType="StackLayout">
            <Setter Property="Orientation" Value="Horizontal"/>
            <Setter Property="HorizontalOptions" Value="CenterAndExpand"/>
        </Style>

        <Style x:Key="LabelStyle" TargetType="Label">
            <Setter Property="VerticalOptions" Value="Center"/>
            <Setter Property="HorizontalOptions" Value="End"/>
            <Setter Property="TextColor" Value="{StaticResource UchWhiteColor}"/>
            <Setter Property="FontSize" Value="12"/>
        </Style>

        <Style x:Key="ImageStyle" TargetType="Image">
            <Setter Property="VerticalOptions" Value="Center"/>
            <Setter Property="HorizontalOptions" Value="Center"/>
            <Setter Property="Margin" Value="3"/>
        </Style>

        <Style x:Key="BoxStyle" TargetType="abstractions:RoundedBoxView">
            <Setter Property="HorizontalOptions" Value="FillAndExpand" />
            <Setter Property="HeightRequest" Value="35" />
            <Setter Property="Opacity" Value=".9" />
            <Setter Property="BackgroundColor" Value="{StaticResource UchWhiteColor}" />
            <Setter Property="BorderThickness" Value="0" />
            <Setter Property="CornerRadius" Value="5" />
        </Style>

    </ResourceDictionary>
</ContentPage.Resources>

<ContentPage.Content>
    <userControls:ToastView Text="{Binding ShieldText}">
        <userControls:ToastView.ContainerContent>
            <ScrollView>
        <RelativeLayout>
            <Image
                x:Name="LoginImage"
                RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width,Factor=1}"
                RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height,Factor=0.5}" 
                Aspect="AspectFit">
            </Image>

            <Grid
                RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent,Property=Width,Factor=1}" 
                RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent,Property=Height,Factor=1}">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>


                <StackLayout Grid.Row="1" Margin="0,10,0,0">
                    <Grid x:Name="GridUsername">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="35" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>

                        <abstractions:RoundedBoxView Grid.ColumnSpan="2" Grid.Row="0" Style="{StaticResource BoxStyle}"/>
                        <Image Source="user_red.png" Grid.Column="0" Grid.Row="0" Style="{StaticResource ImageStyle}">
                            <Image.GestureRecognizers>
                                <TapGestureRecognizer Tapped="OnUserTapped" />
                            </Image.GestureRecognizers>
                        </Image>
                                <ext:CustomEntry x:Name="EntryUsername" Placeholder="{Binding TxtUsername}" Text="{Binding UserName}" Grid.Column="1" Grid.Row="0" Style="{StaticResource EntryStyle}" Focused="Entry_Focused" Unfocused="Entry_Unfocused" AutomationId="TxtUsername">
                            <Entry.Keyboard>
                                <Keyboard x:FactoryMethod="Create">
                                    <x:Arguments>
                                        <KeyboardFlags>None</KeyboardFlags>
                                    </x:Arguments>
                                </Keyboard>
                            </Entry.Keyboard>
                        </ext:CustomEntry>
                    </Grid>

                    <Grid x:Name="GridUsernameOptions">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="1.5*" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>

                        <StackLayout Grid.Column="0" Grid.Row="0" HorizontalOptions="Start" VerticalOptions="Center">
                            <Label x:Name="LabelForgotUserName" Text="{Binding TxtForgotUsername}" HorizontalTextAlignment="Start" Style="{StaticResource LabelStyle}" AutomationId="ForgotUsername">
                                <Label.GestureRecognizers>
                                    <TapGestureRecognizer Command="{Binding ForgotUsername}" />
                                </Label.GestureRecognizers>
                            </Label>
                        </StackLayout>

                        <StackLayout Grid.Column="1" Grid.Row="0" VerticalOptions="Center">
                            <Grid x:Name="GridToggleControlsUsername">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="44" />
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>

                                <Label x:Name="LabelRememberMe" Text="{Binding TxtRememberUsername}" Grid.Row="0" Grid.Column="0"  HorizontalOptions="End" Style="{StaticResource LabelStyle}"/>
                                <Switch x:Name="SwitchRememberMe" Grid.Row="0" Grid.Column="1" Scale=".75" IsToggled="{Binding RememberMe}" HorizontalOptions="End" AutomationId="RememberMe"/>
                            </Grid>
                        </StackLayout>
                    </Grid>

                    <Grid x:Name="GridPassword">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="35" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>

                        <abstractions:RoundedBoxView Grid.ColumnSpan="2" Grid.Row="0" Style="{StaticResource BoxStyle}"/>
                        <Image Source="lock_red.png" Grid.Column="0" Grid.Row="0" Style="{StaticResource ImageStyle}">
                            <Image.GestureRecognizers>
                                <TapGestureRecognizer Tapped="OnLockTapped" />
                            </Image.GestureRecognizers>
                        </Image>
                                <ext:CustomEntry x:Name="EntryPassword" Placeholder="{Binding TxtPassword}" Text="{Binding Password}" IsPassword="True"  Grid.Column="1" Grid.Row="0" Style="{StaticResource EntryStyle}"  Focused="Entry_Focused" Unfocused="Entry_Unfocused" AutomationId="TxtPassword">
                            <Entry.Keyboard>
                                <Keyboard x:FactoryMethod="Create">
                                    <x:Arguments>
                                        <KeyboardFlags>None</KeyboardFlags>
                                    </x:Arguments>
                                </Keyboard>
                            </Entry.Keyboard>
                        </ext:CustomEntry>
                    </Grid>

                    <Grid x:Name="GridPasswordOptions">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="1.5*" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>

                        <StackLayout Grid.Column="0" Grid.Row="0" HorizontalOptions="Start" VerticalOptions="Center">
                            <Label x:Name="LabelForgotPassword" Text="{Binding TxtForgotPassword}" HorizontalTextAlignment="Start" Style="{StaticResource LabelStyle}" AutomationId="ForgotPassword">
                                <Label.GestureRecognizers>
                                    <TapGestureRecognizer Command="{Binding ForgotPassword}" />
                                </Label.GestureRecognizers>
                            </Label>
                        </StackLayout>

                        <StackLayout Grid.Column="1" Grid.Row="0" VerticalOptions="Center">
                            <Grid x:Name="GridToggleControlsPassword">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="44" />
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>

                                <Label x:Name="LabelKeepMeLoggedIn" Text="{Binding TxtKeepMeLoggedIn}" Grid.Row="0" Grid.Column="0" HorizontalOptions="End" Style="{StaticResource LabelStyle}"/>
                                <Switch x:Name="SwitchKeepMeLoggedIn" Grid.Row="0" Grid.Column="1"   Scale=".75" IsToggled="{Binding KeepMeLoggedIn}" HorizontalOptions="End" AutomationId="KeepMeLoggedIn"/>
                            </Grid>
                        </StackLayout>
                    </Grid>

                    <ext:CustomButton x:Name="BtnSignIn" WidthRequest="200" Text="{Binding TxtSignIn}" Command="{Binding Login}" Margin="0,5,0,0" Style="{StaticResource UchRedButton}" AutomationId="SignIn"/>

                    <StackLayout VerticalOptions="End" Margin="0,10,0,10" Style="{StaticResource StackBottomStyle}">
                        <Label x:Name="LabelSignUp" Text="{Binding TxtSignUp}" Style="{StaticResource LabelStyle}" >
                            <Label.GestureRecognizers>
                                <TapGestureRecognizer Command="{Binding SignUp}" />
                            </Label.GestureRecognizers>
                        </Label>
                        <Label x:Name="LabelSeparator" Text=" | " Style="{StaticResource LabelStyle}"></Label>
                        <Label x:Name="LabelContinueAsGuest" Text="{Binding TxtContinueAsGuest}" Style="{StaticResource LabelStyle}" AutomationId="GuestSignIn">
                            <Label.GestureRecognizers>
                                <TapGestureRecognizer Command="{Binding GuestLogin}"/>
                            </Label.GestureRecognizers>
                        </Label>
                    </StackLayout>

                </StackLayout>

            </Grid>
        </RelativeLayout>
    </ScrollView>
        </userControls:ToastView.ContainerContent>
    </userControls:ToastView>
</ContentPage.Content>

....for example this button doesn't show the background color..

Tagged:
Sign In or Register to comment.