Click here to Skip to main content
15,888,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I use the following code to create a xamarin form using visual studio for android when i look into the output lot of spaces between the controls.

Attachment contains output in emulator. Please let me know how to reduce the space between the controls[enter image description here][1].
Code use to create a form:
<?xml version="1.0" encoding="utf-8" ?>
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:d="http://xamarin.com/schemas/2014/forms/design"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             mc:Ignorable="d"
             x:Class="SCC.Home">
    <ContentPage Title="Home" >
        <StackLayout>
        <Grid  ColumnSpacing="0" RowSpacing="0">
            <Grid.RowDefinitions>
                <RowDefinition></RowDefinition>
                <RowDefinition></RowDefinition>
                <RowDefinition></RowDefinition>
                <RowDefinition></RowDefinition>
            </Grid.RowDefinitions>
            <Grid Grid.Row="0" >
                <CarouselView x:Name="Imageslider">
                    <CarouselView.ItemTemplate>
                        <DataTemplate>
                            <Image Source="{Binding .}" Aspect="AspectFill" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"></Image>
                        </DataTemplate>
                    </CarouselView.ItemTemplate>
                </CarouselView>
            </Grid>
            <Label Grid.Row="1" HorizontalOptions="Center" VerticalOptions="CenterAndExpand" TextColor="Black" Text="About Us" VerticalTextAlignment="Center" FontSize="Large" />
            <Label Grid.Row="2" Padding="2,0,2,0" HorizontalTextAlignment="Center"  VerticalOptions="Center" HorizontalOptions="Center"  Text="Surabi Institute of Hotel Management and Fashion Technology recognized by Bharathidhasan University. Surabi Institute of Hotel Management and Fashion Technology was established in the year of 2006. The aim of the Founder is to Provide Hotel Management / Fashion Technology to the poor and Need of the Society">
            </Label>
            <!-- Place new controls here -->
            <Label Grid.Row="3"   
           HorizontalOptions="Center" VerticalOptions="CenterAndExpand" TextColor="#FF5F23" Text="Saravana Educational & Welfare Trust" />
        </Grid>
        </StackLayout>
    </ContentPage>
    <ContentPage Title="Courses" />
  <ContentPage Title="Contact Us" />
  
</TabbedPage>


What I have tried:

<?xml version="1.0" encoding="utf-8" ?>
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:d="http://xamarin.com/schemas/2014/forms/design"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             mc:Ignorable="d"
             x:Class="SCC.Home">
    <ContentPage Title="Home" >
        <StackLayout>
        <Grid  ColumnSpacing="0" RowSpacing="0">
            <Grid.RowDefinitions>
                <RowDefinition></RowDefinition>
                <RowDefinition></RowDefinition>
                <RowDefinition></RowDefinition>
                <RowDefinition></RowDefinition>
            </Grid.RowDefinitions>
            <Grid Grid.Row="0" >
                <CarouselView x:Name="Imageslider">
                    <CarouselView.ItemTemplate>
                        <DataTemplate>
                            <Image Source="{Binding .}" Aspect="AspectFill" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"></Image>
                        </DataTemplate>
                    </CarouselView.ItemTemplate>
                </CarouselView>
            </Grid>
            <Label Grid.Row="1" HorizontalOptions="Center" VerticalOptions="CenterAndExpand" TextColor="Black" Text="About Us" VerticalTextAlignment="Center" FontSize="Large" />
            <Label Grid.Row="2" Padding="2,0,2,0" HorizontalTextAlignment="Center"  VerticalOptions="Center" HorizontalOptions="Center"  Text="Surabi Institute of Hotel Management and Fashion Technology recognized by Bharathidhasan University. Surabi Institute of Hotel Management and Fashion Technology was established in the year of 2006. The aim of the Founder is to Provide Hotel Management / Fashion Technology to the poor and Need of the Society">
            </Label>
            <!-- Place new controls here -->
            <Label Grid.Row="3"   
           HorizontalOptions="Center" VerticalOptions="CenterAndExpand" TextColor="#FF5F23" Text="Saravana Educational & Welfare Trust" />
        </Grid>
        </StackLayout>
    </ContentPage>
    <ContentPage Title="Courses" />
  <ContentPage Title="Contact Us" />
  
</TabbedPage>
Posted
Updated 26-May-20 23:44pm
Comments
Member 11183856 25-May-20 21:46pm    
https://i.stack.imgur.com/sZauY.png

output from emaulator

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900