xaml - 无论方向如何,如何为我的签名板设置恒定高度?
问题描述
在 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>
如何为我的签名板保持永久高度?
解决方案
采用HeightRequest
<signaturePad:SignaturePadView HeightRequest="200" ... />
推荐阅读
- node.js - 如何导入像“MyOwnLibrary/data”这样的模块
- python - 如何创建多个 1D 轴以彩色线条显示间隔?
- string - 在 Visual Studio 中更改字符串颜色不会更改引号颜色。那么我该如何改变呢?
- amazon-dynamodb - DynamoDB:从主键中获取所有排序键
- module - 在 Julia 的另一个模块中包含一个模块
- azure - 如何使用逻辑应用与大文件的 azure 函数从 blob 存储上传文件
- javascript - JavaScript如何对语言环境和英语进行排序
- java - Multicastsocket 在无限循环中不断接收相同的消息
- c - C中的字符串存储
- android - 无法理解 BasicActivity 项目显示其自动生成的布局的方式