第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

Xamarin布局問題,如何在屏幕底部制作拖車按鈕

Xamarin布局問題,如何在屏幕底部制作拖車按鈕

C#
胡說叔叔 2022-12-04 10:32:44
我正在學(xué)習(xí) Xamarin 的布局并面對以下代碼:<?xml version="1.0" encoding="utf-8" ?><ContentPage xmlns="http://xamarin.com/schemas/2014/forms"             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"             xmlns:local="clr-namespace:MyApp.Validators"             x:Class="MyApp.MainPage">    <StackLayout HorizontalOptions="Fill"  >        <Grid>            <Grid.RowDefinitions>                <RowDefinition Height="*" ></RowDefinition>                <RowDefinition Height="*"></RowDefinition>                <RowDefinition Height="*"></RowDefinition>            </Grid.RowDefinitions>            <Grid.ColumnDefinitions>                <ColumnDefinition  ></ColumnDefinition>            </Grid.ColumnDefinitions>            <Grid Grid.Row="0" Grid.Column="0">                <Grid.RowDefinitions>                    <RowDefinition Height="*" ></RowDefinition>                    <RowDefinition Height="*"></RowDefinition>                    <RowDefinition Height="*"></RowDefinition>                </Grid.RowDefinitions>                <Grid.ColumnDefinitions>                    <ColumnDefinition></ColumnDefinition>                </Grid.ColumnDefinitions>                <Entry x:Name="Username" Grid.Row="0" Placeholder="Username" PlaceholderColor="Blue">                    <Entry.Behaviors>                        <local:UsernameValidatorBehavior></local:UsernameValidatorBehavior>                    </Entry.Behaviors>                </Entry>                <Entry x:Name="Password" Grid.Row="1" Keyboard="Numeric" Placeholder="Password" PlaceholderColor="Blue">                    <Entry.Behaviors>                        <local:PasswordValidatorBehavior></local:PasswordValidatorBehavior>                    </Entry.Behaviors>                </Entry>我的問題是我嘗試使用<Grid VerticalOptions="End" Grid.Row="1" Grid.Column="0">使兩個(gè)按鈕位于屏幕底部,但它顯示在屏幕中間。如何解決這個(gè)問題呢?
查看完整描述

1 回答

?
肥皂起泡泡

TA貢獻(xiàn)1829條經(jīng)驗(yàn) 獲得超6個(gè)贊

下面的代碼將為您工作,將 VerticalOptions="FillAndExpand" 添加到 Grid 并提供百分比高度。


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

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"

             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"

             xmlns:local="clr-namespace:MyApp.Validators"

             x:Class="MyApp.MainPage">

<StackLayout HorizontalOptions="Fill">

            <Grid VerticalOptions="FillAndExpand">

                <Grid.RowDefinitions>

                    <RowDefinition Height="1*" />

                    <RowDefinition Height="1*" />

                    <RowDefinition Height="1*" />

                    <RowDefinition Height="7*" />

</Grid.RowDefinitions>

<Grid.ColumnDefinitions>

<ColumnDefinition Width="*"></ColumnDefinition>

<ColumnDefinition Width="*"></ColumnDefinition>

</Grid.ColumnDefinitions>

<Entry x:Name="Username" Grid.Row="0" Grid.ColumnSpan="2" Placeholder="Username" PlaceholderColor="Blue">

<Entry.Behaviors>

<local:UsernameValidatorBehavior></local:UsernameValidatorBehavior>

</Entry.Behaviors>

</Entry>

<Entry x:Name="Password" Grid.Row="1" Grid.ColumnSpan="2" Keyboard="Numeric" Placeholder="Password" PlaceholderColor="Blue">

<Entry.Behaviors>

<local:PasswordValidatorBehavior></local:PasswordValidatorBehavior>

</Entry.Behaviors>

</Entry>

<Entry x:Name="Email" Grid.Row="2" Grid.ColumnSpan="2" Placeholder="Email" PlaceholderColor="Blue">

<Entry.Behaviors>

<local:EmailValidatorBehavior></local:EmailValidatorBehavior>

</Entry.Behaviors>

</Entry>

<Button x:Name="Submit" Grid.Row="3" Grid.Column="0" VerticalOptions="EndAndExpand" Text="Submit" Clicked="OnButtonClicked"></Button>

<Button x:Name="Cancel" Grid.Row="3" Grid.Column="1" 

VerticalOptions="EndAndExpand" Text="Cancel" Clicked="Cancel_Clicked"></Button>

</Grid>   

</StackLayout>

</ContentPage>


查看完整回答
反對 回復(fù) 2022-12-04
  • 1 回答
  • 0 關(guān)注
  • 95 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)