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

Signature not preserved when Android device is rotated #64

Open
mattleibow opened this issue May 5, 2017 · 4 comments
Open

Signature not preserved when Android device is rotated #64

mattleibow opened this issue May 5, 2017 · 4 comments
Labels

Comments

@mattleibow
Copy link
Contributor

This was originally mentioned here: https://forums.xamarin.com/discussion/68380/signature-in-signature-pad-getting-misplaced-while-changing-screen-orientation

This is most probably related to the Activity lifecycle. The entire view is being destroyed and re-created when the device is rotated. And, we do not save/restore state within the view.

@mattleibow mattleibow added the bug label May 5, 2017
@gtbuchanan
Copy link
Contributor

Same thing happens on iOS. My workaround is to clear the signature on orientation change so I don't end up with an off-screen signature.

@Vladis466
Copy link

Im seeing the same issue.

Howeever when navigating to and from the signaturepage (changing from portrait and landscape and back) the behavior I get is the following:

The UI appears as it would in landscape but the overall app appears in portrait (so approximately half the app does not appear on the screen).

@Vladis466
Copy link

So I found an interesting work around. I'm using native messaging center to force the portrait landscape thing and this bug would keep occurring no matter where I called it from (primarily using OnAppearing()).

However the UI would fix itself after an action, such as moving to a tabbed view. I was able to get around the UI landscape/portrait bugout by calling the forceLandscape or forcePortrait from my viewmodel before popping/pushing the new page.

Example below:
MessagingCenter.Send((Views.SignaturePage)Navigation.NavigationStack[Navigation.NavigationStack.Count - 1], "forcePortrait");
For this to work you need to get ahold of the current page casted to the correct type. (I exploited the fact that I am passing the navigation to my VM).

@sk1llsh0t
Copy link

Any update on this? If a signature was taken in landscape and the device rotates to portrait, the signature gets chopped.

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