Splash screen with Version

AMAXAMAX USMember ✭✭

On my Splash screen, I want to put the App version for both Android and iOS at the bottom

Answers

  • LeonLuLeonLu Member, Xamarin Team Xamurai

    Here is my screenshot.

    You can use following code. Put the Label to the StackLayout, set the VerticalOptions to end in StackLayout. set the HorizontalOptions to Center for Label.

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


    <ContentPage.Content>

            <Image Source="icon.png"
                    VerticalOptions="CenterAndExpand" 
                HorizontalOptions="CenterAndExpand"
                   />
            <StackLayout BackgroundColor="SkyBlue"  VerticalOptions="End" >
                <Label Text="V 1.0.1"
                 Font="Bold,20"
                 HorizontalOptions="Center"
    
                 />
            </StackLayout>
        </StackLayout>
    </ContentPage.Content>
    

    Here is my demo.

  • JohnHardmanJohnHardman GBUniversity mod
    edited January 19

    @LeonLu - I suspect the OP wants the version number to appear in a native splash screen rather than the first XF page.

    @AMAX - I've seen this answered once (and I do mean, just once) before in the forum (it might have been more generic - how to dynamically create a splash screen rather than explicitly mentioning a version number). I have to dash out now, so don't have time to search right now. See if you can find that previous answer in the forum. If not, I'll have a search when I have time.

  • JKnottJKnott Member ✭✭✭
    edited January 28

    I think @AMAX is looking for a way to programmatically detect and report the version number. Here's a tutorial I found on how to get the build / version number dynamically.

    https://docs.microsoft.com/en-us/xamarin/essentials/version-tracking

    You could simply use this tutorial to gather the build number, and then link it in your XAML code.

    Here's a second tutorial I found.
    https://www.c-sharpcorner.com/article/how-to-get-app-version-and-build-number-in-xamarin-forms/

    Hope that helps!

  • JohnHardmanJohnHardman GBUniversity mod

    @AMAX - If you haven't resolved this already, can you clarify what you are trying to achieve and which bit(s) you need help with.

Sign In or Register to comment.