Multitut
Multitut

Reputation: 2169

How to avoid TableView scroll on XAML Forms?

I have a StackLayout which contains a TableView, a Grid and a couple Labels.

My problem is that the StackLayout forces all elements to cover 100% of the height of the screen, and it is generating a vertical scroll on my TableView:

enter image description here

I would like to remove that vertical scroll inside the control, and rather have a "global" scroll for the whole view.

This is my XAML code for that view:

<?xml version="1.0" encoding="UTF-8"?>
<ContentPage Title="Create Account" 
    xmlns="http://xamarin.com/schemas/2014/forms" 
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:local="clr-namespace:AudioBitts"
    x:Class="AudioBitts.SignUpPage">
    <StackLayout>
        <TableView x:Name="socialListView">
            <TableRoot>
                <TableSection Title="Social sign up">
                    <ImageCell ImageSource="{local:EmbeddedImage [email protected]}" Text="Sign up with Facebook" />
                    <ImageCell ImageSource="{local:EmbeddedImage [email protected]}" Text="Sign up with Twitter" />
                    <ImageCell ImageSource="{local:EmbeddedImage [email protected]}" Text="Sign up with Google+" />
                </TableSection>
                <TableSection Title="Email sign up">
                    <EntryCell Label="Email" Placeholder="Your email"/>
                    <EntryCell Label="Password" Placeholder="Min 6 characters"/>
                </TableSection>
            </TableRoot>
        </TableView>
        <Grid Padding="20" HorizontalOptions="Center" VerticalOptions="Center">
            <Grid.RowDefinitions>
                <RowDefinition Height="40" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Label Grid.Row="0" Grid.Column="0" Text="Already have an account?" />
            <Label x:Name="onSignIn" Grid.Row="0" Grid.Column="1" Text="Sign In" TextColor="#ff0030" />
        </Grid>
        <Label Text="AudioBitts Inc." HorizontalOptions="Center" /> 
        <Label Text="Terms of Use and Privacy Policy" HorizontalOptions="Center" />
    </StackLayout>
</ContentPage>

Upvotes: 0

Views: 1140

Answers (1)

mindOfAi
mindOfAi

Reputation: 4622

Why don't you just add another <TableSection/>, add a <ViewCell/> and add what's inside the Grid.

Hope it helps!

Upvotes: 2

Related Questions