Forum Libraries, Components, and Plugins
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Broken strokes in Signature Pad (iOS)

DaveCarsonDaveCarson GBUniversity ✭✭✭

I'm working on an iOS app (not Xamarin.Forms) where I need to obtain a signature and after a successful test with the Signature Pad component I have been attempting to implement it.

I have created custom control containing a standard UIView with the Signature Pad and a couple of buttons, wired up with Auto Layout and all that good stuff.

When I display the view on screen it looks fine but when I attempt to draw a signature all I get is a single, short line (see attached). This happens on the simulator and a real device.

The custom view is being added as a subview of a MvxTabBarViewController and being sized to overlay the current tab content. I've seen posts where scroll views were causing problems and I'm wondering if this could be the reason for mine.

For a little more background:

  • Each of the 'strokes' in the screenshot was an attempt to draw a signature - only those fragments were drawn for each attempt.
  • The app is designed to be portrait only
  • I would like to display the Signature Pad in landscape mode (I have the rotation/resizing sorted but commented out in case it was the root of my issue)
  • I am using MvvmCross
  • The tab that it being overlaid is a MvxDialogViewController

Any assistance appreciated!

Best Answers


  • DaveCarsonDaveCarson GBUniversity ✭✭✭

    @mattleibow - you are a superstar!

    Updated to 2.1.1 and that's sorted my problem.

    Thanks again - I was going crazy trying to work out what was going on.

  • DaveCarsonDaveCarson GBUniversity ✭✭✭

    Maybe I spoke too soon :-(

    The signature is now being captured fine - but when I tap the 'Clear' button the gesture of the underlying control is being invoked (in this instance it is displaying an ActionSheet).

    I thought that the Signature Pad or the UIView it is on would prevent the propagation but I'm thinking I must have something missing in my layout configuration.

  • mattleibowmattleibow ZAXamarin Team Xamurai
    I may be misunderstanding, but do you have some view hierarchy, and have a popup/overlay that is the signature pad?

    As the clear button is floating above the canvas, any touch events to the button (which should prevent propagation) that miss the button should be caught by the canvas.
  • DaveCarsonDaveCarson GBUniversity ✭✭✭

    The custom control is being added as a subview of an MvxTabBarViewController - overlaying the displayed tab (an MvxDialogViewController in this instance). The control is added when the user taps a particular Dialog Element on the tab.

    The custom control has a UIView as the 'background' and the Signature Pad (and two buttons) sit on top of that. Somehow the gesture is passing through the Signature Pad, through the 'background' UIView and reading the underlying MvxDialogViewControllers view. I the case of the Clear button this is resulting in a Dialog Element being tapped which opens an ActionSheet.

    I'll carry on with some investigations today and see if I can resolve this issue - I'm so close now :-)

  • DaveCarsonDaveCarson GBUniversity ✭✭✭

    Looks like the problem is introduced when I apply the CGAffineTransform to rotate the view to a landscape orientation and resize it to match the screen (by resetting the frame).

Sign In or Register to comment.