Forum Xamarin.Forms

Announcement:

The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

how to make an image go to the sides of the screen

ive tried to use fill,aspect fill and aspect fit buy they don't change anything. and I'm wondering how to get the picture to fill the screen

Best Answer

  • ColeXColeX Member, Xamarin Team Xamurai
    Accepted Answer

    Modify the Image as

        <Image x:Name="post" Aspect="Fill" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" >
    
                </Image>
    

Answers

  • ColeXColeX Member, Xamarin Team Xamurai
    edited January 22

    The image's size depends on its parent layout , you should make the parent layout full screen first (horizontal) and then size the image .

    Could you post the xaml code here ?


    Xamarin forums are migrating to a new home on Microsoft Q&A!
    We invite you to post new questions in the Xamarin forums’ new home on Microsoft Q&A!
    For more information, please refer to this sticky post.

  • theConfusedOnetheConfusedOne Member ✭✭✭

    @ColeX this is all my xaml code the only thing I do in c# is reference the picture

    <ContentPage.Content>
    
           <StackLayout>
                <StackLayout Orientation="Horizontal">
                    <Image WidthRequest="50" HeightRequest="50">
    
                    </Image>
                    <StackLayout>
                        <Label Text="That_dude1423" FontSize="20" TextColor="#F08B00"  >
    
                        </Label>
                        <Label Text="location:oregon"  >
    
                        </Label>
                    </StackLayout>
                </StackLayout>
    
    
                <Image x:Name="post" Aspect="AspectFit" VerticalOptions="CenterAndExpand" HorizontalOptions="CenterAndExpand" >
    
                </Image>
                <Label Text="That_dude1243: this is a post i made wow so amazing">
    
                </Label>
                <Frame Padding="0,0,0,0" HasShadow="False" HeightRequest="250">
                    <xct:TabView TabStripPlacement="Top" x:Name="reactions"  >
                        <xct:TabViewItem Text="comments" >
                            <xct:TabViewItem.Content>
                                <StackLayout HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
                                    <ScrollView>
                                        <StackLayout>
                                            <Label Text="comments"  FontSize="20"></Label>
                                            <Entry Placeholder="add a useless opinion"></Entry>
                                        </StackLayout>
                                    </ScrollView>
                            </StackLayout>
                            </xct:TabViewItem.Content>
                        </xct:TabViewItem>
                        <xct:TabViewItem Text="likes" TextColorSelected="#F08B00" >
                            <xct:TabViewItem.Content >
                                <StackLayout HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
                                    <ScrollView>
                                        <StackLayout>
                                            <Label Text="likes"  FontSize="20"></Label>
    
                                        </StackLayout>
    
                                    </ScrollView>
                                </StackLayout>
                            </xct:TabViewItem.Content>
                        </xct:TabViewItem>
                        <xct:TabViewItem  Text="republishes" >
                            <xct:TabViewItem.Content>
                                <StackLayout  HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
                                <ScrollView>
                                    <StackLayout>
                                        <Label Text="republises" FontSize="20"></Label>
    
                                    </StackLayout>
    
                                </ScrollView>
                            </StackLayout>
                            </xct:TabViewItem.Content>
                        </xct:TabViewItem>
    
                    </xct:TabView>
    
                </Frame>
    
            </StackLayout>
        </ContentPage.Content>
    </ContentPage>
    
  • ColeXColeX Member, Xamarin Team Xamurai
    Accepted Answer

    Modify the Image as

        <Image x:Name="post" Aspect="Fill" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" >
    
                </Image>
    
Sign In or Register to comment.