无论方向如何,如何为我的签名板放置恒定的高度?

时间:2018-11-16 12:45:49

标签: xaml xamarin signaturepad

在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>

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

1 个答案:

答案 0 :(得分:1)

使用HeightRequest

<signaturePad:SignaturePadView HeightRequest="200" ... />