Set background image and opacity but not the text in the screen

JenalynParagadosJenalynParagados USMember ✭✭
edited June 2018 in Xamarin.Forms

I have set an image as background in the Content Page

But the text or labels inside it affecting the opacity even though I have set the stacklayout opacity to 1. Everything in the screen applied by the opacity i have set in the background image. My goal is to set a background image as water mark to the login screen thats why I need to set the background image into opacity.

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 x:Class="Login"
                 Title="Login"
                 BackgroundImage="login.png"
                 Opacity="0.1">
        <ContentPage.Content>
            <StackLayout Opacity="1">
                <StackLayout Padding="15">
                    <Image Aspect="AspectFit" Source="truck_black.png"
                            WidthRequest="130" HeightRequest="100"/>
                </StackLayout>
                <ScrollView>
                    <StackLayout Spacing="0">
                        <StackLayout Padding="15,7,15,15" VerticalOptions="StartAndExpand">
                            <StackLayout VerticalOptions="StartAndExpand">
                                <Label Text="Company Code" TextColor="Black" FontSize="14"/>
                                <Entry x:Name="companyCodeEntry" TextColor="Black" Text="" FontSize="14"/>
                                <Label Text="Username" TextColor="Black" FontSize="14"/>
                                <Entry x:Name="usernameEntry" TextColor="Black" Text="" FontSize="14"/>
                                <Label Text="Password" TextColor="Black" FontSize="14"/>
                                <Entry x:Name="passwordEntry" IsPassword="true" TextColor="Black" Text="" FontSize="14"/>
                            </StackLayout>
                        </StackLayout>
                    </StackLayout>
                </ScrollView>
            </StackLayout>
        </ContentPage.Content>
    </ContentPage>

Best Answer

Answers

Sign In or Register to comment.