Xamarin.forms 在MasterDetailPage侧栏上不可见的按钮

Xamarin.forms 在MasterDetailPage侧栏上不可见的按钮,xamarin.forms,Xamarin.forms,我得到的问题,我的侧栏的按钮,在底部是不可见的。我想有一些scroolbar如果有更多的按钮比屏幕大小访问它们。我怎样才能做到这一点?多谢各位 看起来就是这样: <MasterDetailPage.Master> <ContentPage Padding="20" BackgroundColor="GhostWhite" Title="Master"> <ContentPage.Co

我得到的问题,我的侧栏的按钮,在底部是不可见的。我想有一些scroolbar如果有更多的按钮比屏幕大小访问它们。我怎样才能做到这一点?多谢各位

看起来就是这样:

<MasterDetailPage.Master>
    <ContentPage Padding="20" BackgroundColor="GhostWhite" Title="Master">
        <ContentPage.Content>
            <StackLayout Margin="5,30,5,5">

                <Label Text="NA" />
                <BoxView Color="Gray" HeightRequest = "2" />
                <Button Text="Tr" BackgroundColor="MidnightBlue" TextColor="White" Command="{Binding SetDetailsToTCommand}" />
                <Label Text="AKC" />
                <BoxView Color="Gray" HeightRequest = "2" />
                <Button Text="Zl" BackgroundColor="DarkBlue" TextColor="White" Command="{Binding SetDetailsToOCommand}" />
                <Button Text="In" BackgroundColor="DarkBlue" TextColor="White" Command="{Binding SetDetailsToInCommand}" IsVisible="{Binding IsBo}" />
                <Button Text="Po" BackgroundColor="Coral" TextColor="White" Command="{Binding SetDetailsToWanieCommand}" IsVisible="{Binding IsBo, Mode=TwoWay}" />
                <Button Text="Re" BackgroundColor="Coral" TextColor="White" Command="{Binding SetDetailsToWaCommand}" IsVisible="{Binding IsBo, Mode=TwoWay}" />
                <Button Text="Zw" BackgroundColor="Coral" TextColor="White" Command="{Binding SetDetailsToWaCommand}" IsVisible="{Binding IsBo, Mode=TwoWay}" />
                <Label Text="GE" />
                <BoxView Color="Gray" HeightRequest = "2" />
                <Button Text="Wpi" BackgroundColor="DarkBlue" TextColor="White" Command="{Binding SetDetailsToWCommand}" IsVisible="{Binding IsBo, Mode=TwoWay}" />
                <Label Text="OPCJ" />
                <BoxView Color="Gray" BackgroundColor="Red" HeightRequest = "2" />
                <Button Text="Zlec" BackgroundColor="Red" TextColor="White" Command="{Binding SetDetailsToOrRealizedCommand}" IsVisible="{Binding IsBo, Mode=TwoWay}" />
            </StackLayout>
        </ContentPage.Content>
    </ContentPage>
</MasterDetailPage.Master>

<MasterDetailPage.Detail>
    <ContentPage Padding="10">
        <ContentPage.Content>
            <StackLayout Margin="5,30,5,5">
                <Label Text="Detail Page"
                       VerticalOptions="CenterAndExpand" 
                       HorizontalOptions="CenterAndExpand" />
            </StackLayout>
        </ContentPage.Content>
    </ContentPage>
</MasterDetailPage.Detail>

代码:

<MasterDetailPage.Master>
    <ContentPage Padding="20" BackgroundColor="GhostWhite" Title="Master">
        <ContentPage.Content>
            <StackLayout Margin="5,30,5,5">

                <Label Text="NA" />
                <BoxView Color="Gray" HeightRequest = "2" />
                <Button Text="Tr" BackgroundColor="MidnightBlue" TextColor="White" Command="{Binding SetDetailsToTCommand}" />
                <Label Text="AKC" />
                <BoxView Color="Gray" HeightRequest = "2" />
                <Button Text="Zl" BackgroundColor="DarkBlue" TextColor="White" Command="{Binding SetDetailsToOCommand}" />
                <Button Text="In" BackgroundColor="DarkBlue" TextColor="White" Command="{Binding SetDetailsToInCommand}" IsVisible="{Binding IsBo}" />
                <Button Text="Po" BackgroundColor="Coral" TextColor="White" Command="{Binding SetDetailsToWanieCommand}" IsVisible="{Binding IsBo, Mode=TwoWay}" />
                <Button Text="Re" BackgroundColor="Coral" TextColor="White" Command="{Binding SetDetailsToWaCommand}" IsVisible="{Binding IsBo, Mode=TwoWay}" />
                <Button Text="Zw" BackgroundColor="Coral" TextColor="White" Command="{Binding SetDetailsToWaCommand}" IsVisible="{Binding IsBo, Mode=TwoWay}" />
                <Label Text="GE" />
                <BoxView Color="Gray" HeightRequest = "2" />
                <Button Text="Wpi" BackgroundColor="DarkBlue" TextColor="White" Command="{Binding SetDetailsToWCommand}" IsVisible="{Binding IsBo, Mode=TwoWay}" />
                <Label Text="OPCJ" />
                <BoxView Color="Gray" BackgroundColor="Red" HeightRequest = "2" />
                <Button Text="Zlec" BackgroundColor="Red" TextColor="White" Command="{Binding SetDetailsToOrRealizedCommand}" IsVisible="{Binding IsBo, Mode=TwoWay}" />
            </StackLayout>
        </ContentPage.Content>
    </ContentPage>
</MasterDetailPage.Master>

<MasterDetailPage.Detail>
    <ContentPage Padding="10">
        <ContentPage.Content>
            <StackLayout Margin="5,30,5,5">
                <Label Text="Detail Page"
                       VerticalOptions="CenterAndExpand" 
                       HorizontalOptions="CenterAndExpand" />
            </StackLayout>
        </ContentPage.Content>
    </ContentPage>
</MasterDetailPage.Detail>


最简单的方法是将所有内容放在滚动视图中,如-

<MasterDetailPage.Master>
    <ContentPage Padding="20" BackgroundColor="GhostWhite" Title="Master">
        <ContentPage.Content>
             <ScrollView>  <------------- HERE 
                 <StackLayout Margin="5,30,5,5">

                   <Label Text="NA" />
                   <BoxView Color="Gray" HeightRequest = "2" />
                   .
                   .
                   .
                </StackLayout>

             </ScrollView> <------------- HERE
        </ContentPage.Content>
    </ContentPage>
</MasterDetailPage.Master>


用滚动视图将stacklayout包装在母版页中。我会检查它并让您知道