Automatic resize of a XAML content page

Paolo Mossa 181 Reputation points
2023-02-20T07:29:40.9+00:00

I am making an APP that must run either on a Phone or a Tablet. But while it works properly with the drawings it doesn not work with the content pages. The problem is to resize the page with the current dimension of the device.

below an example of a page:

There is a manner to change the dimension of the bottons and the font size of theirs text?

thanks in advanced for any reply

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="AstroSmart.menu" >
    <ContentPage.Content>
        <ScrollView>
            <Grid BackgroundColor="Black">
                <Grid.RowDefinitions>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition>
                    </ColumnDefinition>
                    <ColumnDefinition  />
                </Grid.ColumnDefinitions>
                <Button Text="Generalità" BackgroundColor="Cyan" BorderColor="Blue" BorderWidth="3" Clicked="Button_Clicked" Grid.Row="0" Grid.Column="0" />
                <Button Text="Rivoluzione Lunare" BackgroundColor="YellowGreen" BorderColor="DarkGreen" BorderWidth="3" Clicked="Button1_Clicked" Grid.Row="1" Grid.Column="1" />
                <Button Text="rivoluzione Solare" BackgroundColor="YellowGreen" BorderColor="DarkGreen" BorderWidth="3" Clicked="Button2_Clicked" Grid.Row="1"  />
                <Button Text="rivoluzione Soli/Lunare" BackgroundColor="YellowGreen" BorderColor="DarkGreen" BorderWidth="3" Clicked="Button_Clicked_1" Grid.Row="2" Grid.Column="1"  />
                <Button Text="rivoluzione Luni/Solare" BackgroundColor="YellowGreen" BorderColor="DarkGreen" BorderWidth="3" Clicked="Button_Clicked_2"  Grid.Row="2"  />
                <Button Text="Oroscopo progressivo" BackgroundColor="YellowGreen" BorderColor="DarkGreen" BorderWidth="3" Clicked="Button3_Clicked" Grid.Row="3" Grid.Column="1" />
                <Button Text="Transiti" BackgroundColor="YellowGreen" BorderColor="DarkGreen" BorderWidth="3" Clicked="Button4_Clicked" Grid.Row="3"  />
                <Button Text="Cielo ora Solare" BackgroundColor="YellowGreen" BorderColor="DarkGreen" BorderWidth="3" Clicked="Button5_Clicked" Grid.Row="4" Grid.Column="1" />
                <Button Text="Cielo ora Legale" BackgroundColor="YellowGreen" BorderColor="DarkGreen" BorderWidth="3" Clicked="Button6_Clicked" Grid.Row="4"  />
                <Button Text="Tema Natale/Sinastrie" BackgroundColor="YellowGreen" BorderColor="DarkGreen" BorderWidth="3" Clicked="Button8_Clicked" Grid.Row="5" Grid.Column="1" />
                <Button Text="Oroscopo Giornaliero" BackgroundColor="YellowGreen" BorderColor="DarkGreen" BorderWidth="3" Clicked="Button9_Clicked" Grid.Row="5"  />
                <Button Text="Ricerca" BackgroundColor="YellowGreen" BorderColor="DarkGreen" BorderWidth="3" Clicked="Button10_Clicked" Grid.Row="6" Grid.Column="1" />
                <Button Text="Oroscopo Trimestrale" BackgroundColor="YellowGreen" BorderColor="DarkGreen" BorderWidth="3" Clicked="Button11_Clicked" Grid.Row="6"  />
                <Button Text="Email" BackgroundColor="BurlyWood" BorderColor="DarkGreen" BorderWidth="3" Clicked="Button12_Clicked" Grid.Row="11" Grid.Column="1" />
                <Button Text="SMS" BackgroundColor="BurlyWood" BorderColor="DarkGreen" BorderWidth="3"  Clicked="Button13_Clicked" Grid.Row="11"  />
                <Button Text="Gestione Nominativi" BackgroundColor="LightGray" BorderColor="DarkGreen" BorderWidth="3" Clicked="Button7_Clicked" Grid.Row="14" Grid.Column="1" />
                <Button Text="Gestione Città" BackgroundColor="LightGray" BorderColor="DarkGreen" BorderWidth="3"  Clicked="Button14_Clicked" Grid.Row="13"  />
                <Button Text="Gestione File" BackgroundColor="LightGray"  BorderColor="DarkGreen" BorderWidth="3" Clicked="Button15_Clicked" Grid.Row="13" Grid.Column="1"  />
                <Button Text="Direzioni Primarie" BackgroundColor="YellowGreen" BorderColor="DarkGreen" BorderWidth="3" Clicked="Button16_Clicked" Grid.Row="7"  />
                <Button Text="Rivoluzione di Venere" BackgroundColor="YellowGreen" BorderColor="DarkGreen" BorderWidth="3" Clicked="Button_Clicked_3" Grid.Row="8"  />
                <Button Text="Rivoluzione di Mercurio" BackgroundColor="YellowGreen" BorderColor="DarkGreen" BorderWidth="3" Clicked="Button_Clicked_4" Grid.Row="8" Grid.Column="1"  />
                <Button Text="Rivoluzione di Marte" BackgroundColor="YellowGreen" BorderColor="DarkGreen" BorderWidth="3" Clicked="Button_Clicked_5" Grid.Row="9"  />
                <Button Text="Profezioni" BackgroundColor="YellowGreen" BorderColor="DarkGreen" BorderWidth="3" Clicked="Button17_Clicked" Grid.Row="7" Grid.Column="1"  />
                <Button Text="Chiudi" BackgroundColor="Salmon" BorderColor="Red" BorderWidth="3" Clicked="Button18_Clicked" Grid.Row="16"  />
            </Grid>
        </ScrollView>
    </ContentPage.Content>

Developer technologies | .NET | Xamarin
Developer technologies | XAML
0 comments No comments
{count} votes

Accepted answer
  1. Alessandro Caliaro 4,196 Reputation points
    2023-02-20T07:52:26.82+00:00
    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.