在xamarin表单中启用scrollview时,签名板不起作用

时间:2018-05-22 13:17:00

标签: xamarin.forms

我正在使用xamarin.forms。 我使用SignaturePad.Xamarin.Forms.PCL作为签名板。这是我的代码:

<?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:acr="clr-namespace:Acr.XamForms.SignaturePad;assembly=Acr.XamForms.SignaturePad"
             x:Class="App4.newpage">
    <ContentPage.Content>
        <ScrollView Orientation="Vertical">
            <StackLayout>
                <Button Text="button1"/>
                <Button Text="button2"/>
                <Button Text="button3"/>
                <Button Text="button4"/>
                <Button Text="button5"/>
                <Button Text="button6"/>
                <Button Text="button7"/>
                <Button Text="button8"/>

                <acr:SignaturePadView
                x:Name="padView"
                HeightRequest="320"
                WidthRequest="240"
                BackgroundColor="White"
                CaptionText="Caption This"
                CaptionTextColor="Black"
                ClearText="Clear Me!"
                ClearTextColor="Red"
                PromptText="Prompt Here"
                PromptTextColor="Red"
                SignatureLineColor="Aqua"
                StrokeColor="Black"
                StrokeWidth="2" 
            />
            </StackLayout>
        </ScrollView>
    </ContentPage.Content>
</ContentPage>

由于使用了scrollview,我无法在签名板上工作。

有人可以帮我解决这个问题吗?

1 个答案:

答案 0 :(得分:0)

我认为这里唯一明显的答案是:不要把它放在ScrollView中。我可以想象,如果你想滚动或画一条线,UI就无法区分。

即使你开始工作,我也不认为用户体验会很棒。如果用户的设备类型较小,签名控件占据整个屏幕会发生什么情况,那么您将如何在那时滚动出来?

当然,我不知道您的要求是什么,但也许您可以添加一个按钮,将您带到新屏幕以添加签名?