如何显示水平按钮

时间:2017-06-10 05:00:23

标签: xamarin.forms

您好我可以在Forms中使用多个stackLayout吗?

布局下方无法在Android手机中显示:

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:mIWIS"
             x:Class="myApp.MainPage">

    <ContentPage.Content>

        <StackLayout  Orientation="Vertical" Padding="20,20,20,20">
            <Label Text="Username" />
            <Entry x:Name="usernameEntry" Placeholder="username" />
            <Label Text="Password" />
            <Entry x:Name="passwordEntry" IsPassword="true" Placeholder="Password"  />           
            <Label x:Name="messageLabel" />         

        </StackLayout>

        <StackLayout Orientation="Horizontal">

            <Button x:Name="BtnClear" Text="Clear" />
            <Button x:Name="BtnLogin" Text="Login" />

        </StackLayout>

    </ContentPage.Content>


</ContentPage>

由于

1 个答案:

答案 0 :(得分:0)

<ContentPage.Content>
<StackLayout>
        <StackLayout  Orientation="Vertical" Padding="20,20,20,20">
            <Label Text="Username" />
            <Entry x:Name="usernameEntry" Placeholder="username" />
            <Label Text="Password" />
            <Entry x:Name="passwordEntry" IsPassword="true" Placeholder="Password"  />           
            <Label x:Name="messageLabel" />         

        </StackLayout>

        <StackLayout Orientation="Horizontal">

            <Button x:Name="BtnClear" Text="Clear" />
            <Button x:Name="BtnLogin" Text="Login" />

        </StackLayout>
</StackLayout>
    </ContentPage.Content>