Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

Xamarin.Forms SignaturePadView inside Frame not working on UWP #117

Open
jBijsterboschNL opened this issue Feb 8, 2018 · 3 comments
Open
Labels

Comments

@jBijsterboschNL
Copy link

When I put a SignaturePadView inside a Frame, I'm unable to draw on the SignaturePadView. At least on UWP, I've also tested it on Android and that does work. When removing the Frame it also works on UWP.

Xaml code:

<Grid HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Padding="10">
  <Grid.ColumnDefinitions>
    <ColumnDefinition Width="*" />
  </Grid.ColumnDefinitions>
  <Grid.RowDefinitions>
    <RowDefinition Height="*"/>
  </Grid.RowDefinitions>

  <Image Source="{Binding PhotoPath}" Aspect="AspectFit" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" />
                
  <sig:SignaturePadView BackgroundColor="Transparent" ClearText="Clear" ClearTextColor="{StaticResource Black}" CaptionText="" SignatureLineColor="Transparent" StrokeColor="Red" StrokeWidth="2" />
</Grid>
@bruzkovsky
Copy link

bruzkovsky commented Mar 1, 2018

I can confirm this when changing the SignatureXamlView.xaml from the samples to the following, I can no longer draw on the pad:

<?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:signature="clr-namespace:SignaturePad.Forms;assembly=SignaturePad.Forms"
             x:Class="Samples.Views.SignatureXamlView"
             Title="XAML Code-Behind" Padding="10,10,10,5">
    <StackLayout>
        <Frame>
            <signature:SignaturePadView x:Name="padView"
                                        HeightRequest="150" 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" />
        </Frame>
        <Button Clicked="OnChangeTheme" Text="Change Theme" />
        <Button Clicked="OnGetStats" Text="Get Signature Stats" />
        <Button Clicked="OnGetImage" Text="Get Signature Image" />
    </StackLayout>
</ContentPage>

Edit:

This is most likely an upstream bug in Xamarin.Forms.

Workaround:

<Frame InputTransparent="True">
<!-- ... -->
</Frame>

@mattleibow
Copy link
Contributor

Thanks for reporting this. I have filed a bug with Xamarin.Forms: xamarin/Xamarin.Forms#2748

@mattleibow mattleibow added the bug label May 16, 2018
@Craigleader
Copy link

I am having the same problem, my problem is that I have three frames in the view, if I add InputTransparent="True" it disabled the other input elements on the page. Are there any other workarounds for this issue?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants