Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set Background Image in Content View in Xamarin

I have one ContentView in which i need to set background Image.There is "BackgroundImage" Property for ContentPage,What to do in ContentView?is it possible in xamarin to set background image in ContentView?

like image 202
Jolly Avatar asked Feb 04 '23 00:02

Jolly


1 Answers

In ContentView use AbsoluteLayout and put Image inside AbsoluteLayout with other controls.It works!!

 <ContentView.Content>
    <AbsoluteLayout HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
        <Image Source="abc.png" AbsoluteLayout.LayoutBounds="0,0,1,1" AbsoluteLayout.LayoutFlags="All" Aspect="AspectFill"/>
        <ScrollView AbsoluteLayout.LayoutBounds="0,0,1,1" AbsoluteLayout.LayoutFlags="All">
            <Grid>
                ......
                ......
            </Grid>
        </ScrollView>
    </AbsoluteLayout>
</ContentView.Content>
like image 141
Jolly Avatar answered Mar 06 '23 04:03

Jolly