1

在 xamarin 应用程序中,我创建了一个签名板,并且我保留了边距

无论设备和方向如何,我都想保持签名区域的永久高度,

我不是 xamarin 开发人员,而且我不知道 xaml,但我仍然尝试了 Margin="200,200,200,200" ,但是当我改变方向时它的行为很奇怪。

在 ipad 的横向模式下,该区域根本不可见。

<?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:signaturePad="clr-namespace:Acr.XamForms.SignaturePad;assembly=Acr.XamForms.SignaturePad"
             x:Class="watebook.Clients.Mobile.Views.CaptureSignature"
             BackgroundColor="{StaticResource PageBackgroundColor}">

    <AbsoluteLayout HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
        <StackLayout AbsoluteLayout.LayoutFlags="All" AbsoluteLayout.LayoutBounds="0,0,1,1">
            <ContentView Style="{StaticResource PageHeaderBodySeparator}" />
            <signaturePad:SignaturePadView
            Margin="200,200,200,200"
            VerticalOptions="FillAndExpand"
            HorizontalOptions="FillAndExpand"
            x:Name="padView"
            BackgroundColor="{StaticResource SignaturePadBackgroundColor}"
            CaptionText="Please sign here"
            CaptionTextColor="{StaticResource SignaturePadCaptionTextColor}"
            PromptText="."
            SignatureLineColor="{StaticResource SignaturePadSignatureLineColor}"
            StrokeColor="{StaticResource SignaturePadSignatureStrokeColor}"
            StrokeWidth="2"
            ClearText="" />
            <Button Text="SAVE SIGNATURE" Clicked="Button_OnClicked" BackgroundColor="#ffd300" TextColor="Black" x:Name="SaveButton" BorderColor="Black" Margin="0,10,0,300" />
        </StackLayout>
        <ContentView Style="{StaticResource ProcessIndicatorContentViewStyle}" x:Name="ActivityCameraIndicators" IsVisible="False" AbsoluteLayout.LayoutFlags="All" AbsoluteLayout.LayoutBounds="0,0,1,1">
            <Label Style="{x:StaticResource ProcessIndicatorLabelStyle}" Text="Processing" x:Name="ActivityIndicatorLable" />
        </ContentView>
    </AbsoluteLayout>
</ContentPage>

如何为我的签名板保持永久高度?

4

1 回答 1

1

采用HeightRequest

<signaturePad:SignaturePadView HeightRequest="200" ... />
于 2018-11-16T12:52:45.670 回答