grid, picture buttons

I have set up a grid so far put up 6 picture buttons 2 next to each other, the picture buttons are then clickable. but when I add more, only the pictures get smaller. wish to have 2 next to each other in the same image size as it is but that should be able to swipe down to look at several image buttons in the same size. anyone who has any suggestions? At the same time, I also try to get text over before the picture buttons. The code I have used you can see below as well as a picture of how I want it.

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

<ContentPage.ToolbarItems>
    <ToolbarItem 
                 Icon="plus.png"
                 Priority="0"
                 Order="Default"
                 Clicked="Todo"/>

    <ToolbarItem 
                 Icon="Home.png"
                 Priority="0"
                 Order="Default"
                 Clicked="Hjem"/>

</ContentPage.ToolbarItems>

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition/>
        <RowDefinition/>
    </Grid.RowDefinitions>

    <Grid.ColumnDefinitions>
        <ColumnDefinition/>
        <ColumnDefinition/>
    </Grid.ColumnDefinitions>

    <!--<Label Text="Friends forever"
                   Style="{StaticResource TextTitle}" HorizontalOptions="Center" VerticalOptions="Center"/>-->

    <ImageButton Source="Friends_forever.png"
                 Grid.Row="0"
                 Grid.Column="0"
                HorizontalOptions="Center"
                VerticalOptions="CenterAndExpand"
                         WidthRequest="250" HeightRequest="250"
                Clicked="Friends_forever" />

    <!--<Label Text="Hamptons Holiday"
                   Style="{StaticResource TextTitle}" HorizontalOptions="Center" VerticalOptions="Center"/>-->

    <ImageButton Source="Hamptons_holiday.png"
                 Grid.Row="0"
                 Grid.Column="1"
                HorizontalOptions="Center"
                VerticalOptions="CenterAndExpand"
                         WidthRequest="250" HeightRequest="250"
                Clicked="Hamptons_holiday" />

    <!--<Label Text="Morocco Love"
                   Style="{StaticResource TextTitle}" HorizontalOptions="Center" VerticalOptions="Center"/>-->

    <ImageButton Source="Morocco_love.png"
                 Grid.Row="1"
                 Grid.Column="0"
                HorizontalOptions="Center"
                VerticalOptions="CenterAndExpand"
                         WidthRequest="250" HeightRequest="250"
                Clicked="Morocco_love" />

    <!--<Label Text="Row by Row"
                   Style="{StaticResource TextTitle}" HorizontalOptions="Center" VerticalOptions="Center"/>-->

    <ImageButton Source="Row_by_row.png" 
                 Grid.Row="1"
                 Grid.Column="1"
                HorizontalOptions="Center"
                VerticalOptions="CenterAndExpand"
                         WidthRequest="250" HeightRequest="250"
                Clicked="Row_by_row" />

    <!--<Label Text="Sonora Sunrise Sweater"
                   Style="{StaticResource TextTitle}" HorizontalOptions="Center" VerticalOptions="Center"/>-->

    <ImageButton Source="Sonora_sunrise_sweater.png" 
                 Grid.Row="2"
                 Grid.Column="0"
                HorizontalOptions="Center"
                VerticalOptions="CenterAndExpand"
                         WidthRequest="250" HeightRequest="250"
                Clicked="Sonora_sunrise_sweater" />

    <!--<Label Text="Sweet Heather"
                   Style="{StaticResource TextTitle}" HorizontalOptions="Center" VerticalOptions="Center"/>-->

    <ImageButton Source="Sweet_heather.png" 
                 Grid.Row="2"
                 Grid.Column="1"
                HorizontalOptions="Center"
                VerticalOptions="CenterAndExpand"
                         WidthRequest="250" HeightRequest="250"
                Clicked="Sweet_heather" />

    <!--<Label Text="Sweet Heather"
                   Style="{StaticResource TextTitle}" HorizontalOptions="Center" VerticalOptions="Center"/>-->

    <ImageButton Source="Cloudscape.png" 
                 Grid.Row="2"
                 Grid.Column="1"
                HorizontalOptions="Center"
                VerticalOptions="CenterAndExpand"
                         WidthRequest="250" HeightRequest="250"
                Clicked="Cloudscape" />
</Grid>

Best Answer

Answers

  • themarwikthemarwik Member

    @DirkWilhelm said:
    A grid itself is not scrollable. Wrap your grid into a ScrollView

    Thanks that worked fine. do you know how to add a text over the image button in the grid?

Sign In or Register to comment.