Need to image in stacklayout horizontal like password pin page

Suriya_KalidossSuriya_Kalidoss Member ✭✭✭

I need to add image in horizontal manner ..I need to add image like this please help.

Tagged:

Best Answer

Answers

  • Suriya_KalidossSuriya_Kalidoss Member ✭✭✭

        </StackLayout>
    

    code behind
    Image im = new Image();

            im.Source  = ImageSource.FromFile("circle.png");
    
    stack.Children.Add(im);
            stack.Children.Add(im);
            stack.Children.Add(im);
    

    only single image is shown in view .how to view multiple

  • Suriya_KalidossSuriya_Kalidoss Member ✭✭✭

    I would to know how to add single child multiple times in stack layout

  • JamesLaveryJamesLavery GBBeta, University ✭✭✭✭✭

    Without seeing more of your code and a screenshot of the results, it's hard to know what the problem is.

    However, it is entirely possible to achieve what you want- see the example XAML below, which gives the resulting screenshot.

    <?xml version="1.0" encoding="utf-8"?>
    <ContentPage
        xmlns     ="http://xamarin.com/schemas/2014/forms"
        xmlns:x    ="http://schemas.microsoft.com/winfx/2009/xaml"
        xmlns:local="clr-namespace:StackedImage"
        x:Class    ="StackedImage.MainPage">
        <StackLayout
            Orientation="Vertical">
            <!-- Place new controls here -->
            <Label
                Text             ="Welcome to Xamarin.Forms!"
                HorizontalOptions="Center"
                VerticalOptions  ="CenterAndExpand" />
            <StackLayout
                Padding        ="0,0,0,50"
                BackgroundColor="Blue"
                VerticalOptions="Start"
                Orientation    ="Horizontal">
                <Image
                    HeightRequest="50"
                    Source       ="RedCircle.png" />
                <Image
                    HeightRequest="50"
                    Source       ="RedCircle.png" />
                <Image
                    HeightRequest="50"
                    Source       ="RedCircle.png" />
                <Image
                    HeightRequest="50"
                    Source       ="RedCircle.png" />
            </StackLayout>
        </StackLayout>
    </ContentPage>
    

  • MommMomm USMember ✭✭✭

    @Suriya_Kalidoss said:
    I would to know how to add single child multiple times in stack layout

    I believe you need to create the same "new Image()" multiple times and add each one of them.

Sign In or Register to comment.