MTBBarcodeScanner icon indicating copy to clipboard operation
MTBBarcodeScanner copied to clipboard

UIView preview has issues during orientation changes

Open jpshelley opened this issue 5 years ago • 6 comments

When using the pod in my own app and the example app on an iPad, whenever I rotate the screen the view itself no longer retains its original constraints. Most of the time it appears to take on padding on the side. I'll upload an image once I am able to later

jpshelley avatar Mar 02 '20 01:03 jpshelley

@jpshelley can you try comparing your constraints to those in the sample application included in the Project folder of this repo? If you are able to reproduce this issue in the sample app, that would be helpful for debugging this.

mikebuss avatar Mar 02 '20 01:03 mikebuss

I am going to close this issue for now. @jpshelley if you can reproduce this issue in the included demo projects, please feel free to update this ticket. If you are not able to reproduce the issues in the demo project, it's likely an issue with your constraints.

If there's something specific you're trying to achieve, you may want to update the demo projects to see what step introduces the issue.

mikebuss avatar Mar 03 '20 17:03 mikebuss

Yes I can reproduce it in the example app even. I'll upload an image/video sometime this week.

jpshelley avatar Mar 03 '20 19:03 jpshelley

@mikebuss this issue is indeed present. I have just seen the behaviour on the sample app. You can see the problem in the video uploaded here: Streamable essentially, the library ceases to recognize codes on an orientation change, requiring a restart of the scanner before it starts recognising again.

sashahilton00 avatar Jul 16 '20 16:07 sashahilton00

Thanks @sashahilton00. I'll reopen this and take a look. It may be that you need to supply a new scanRect when the orientation changes, but I'll update the ticket with what I find.

mikebuss avatar Jul 16 '20 16:07 mikebuss

Sorry for the delay in responding to this.

I am not longer actively maintaining this library, but if anyone reading this has a solution and wants to submit a pull request I will merge it in. Apologies for the inconvenience.

mikebuss avatar Oct 01 '20 00:10 mikebuss