januslo / react-native-sunmi-inner-scanner

根据http://docs.sunmi.com/htmls/index.html?lang=zh##V1文档资源 开发的适用与react-native的商米扫码启动器。
24 stars 23 forks source link

SunmiScannerView 组件 显示时 下方有部分空白 #2

Closed angrycans closed 7 years ago

angrycans commented 7 years ago

SunmiScannerView 组件调用时 下方有部分空白

你的example 里面就能明显看到 ,那个空白 如果在页面中返回到其他页面 也会影响到其他页面的显示效果

没个页面都会留下空白, 感觉是application的高度计算的不对,然后只有全屏重绘时才能刷新掉,

angrycans commented 7 years ago

https://github.com/WuZhuoXuan/react-native-SPRTprint/blob/master/error1.png

https://github.com/WuZhuoXuan/react-native-SPRTprint/blob/master/error2.png

https://github.com/WuZhuoXuan/react-native-SPRTprint/blob/master/error3.png

januslo commented 7 years ago

没有看懂你的问题……我这里有两个组件。第一个是sunmi 内置扫描器……就是你error1图片显示的那个。如果是显示不全的问题,请自行询问商米。 第二个是一个自定义组件,这个组件是提供给大家做内嵌扫描的,例子中的留白是刻意的,也是正常的。

发自我的 iPhone

在 2017年7月3日,下午5:23,angrycans notifications@github.com 写道:

https://github.com/WuZhuoXuan/react-native-SPRTprint/blob/master/error1.png

https://github.com/WuZhuoXuan/react-native-SPRTprint/blob/master/error2.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

angrycans commented 7 years ago

我找了下问题 如果SunmiScannerView style flex=1 或者width=Dimensions.get('window'); 时

scanner: { height: 450, justifyContent: 'center', alignItems: 'center' },

这种情况下 在很多机型上面 返回时 页面render都会不正常 只有给width=width-1 才能正常 也就是width 在camera preview 可能计算的不对

你可以试试你的demo 给上navigation 给我返回到上个页面试试

januslo commented 7 years ago

很多机型?商米不是只有几个机型么?

发自我的 iPhone

在 2017年7月4日,上午9:23,angrycans notifications@github.com 写道:

我找了下问题 如果SunmiScannerView style flex=1 或者width=Dimensions.get('window'); 时

scanner: { height: 450, justifyContent: 'center', alignItems: 'center' },

这种情况下 在很多机型上面 返回时 页面render都会不正常 只有给width=width-1 才能正常 也就是width 在camera preview 可能计算的不对

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

angrycans commented 7 years ago

有款乐视居然也可以使用这个扫码

janus j k lu notifications@github.com于2017年7月4日 周二10:55写道:

很多机型?商米不是只有几个机型么?

发自我的 iPhone

在 2017年7月4日,上午9:23,angrycans notifications@github.com 写道:

我找了下问题 如果SunmiScannerView style flex=1 或者width=Dimensions.get('window'); 时

scanner: { height: 450, justifyContent: 'center', alignItems: 'center' },

这种情况下 在很多机型上面 返回时 页面render都会不正常 只有给width=width-1 才能正常 也就是width 在camera preview 可能计算的不对

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/januslo/react-native-sunmi-inner-scanner/issues/2#issuecomment-312768542, or mute the thread https://github.com/notifications/unsubscribe-auth/AHBHYwBDAwfsnBzx6RzDWi92wmVBR4nUks5sKamngaJpZM4OMB4k .

-- 这家伙很懒 没有签名

januslo commented 7 years ago

嵌入View的插件应该安卓都可以,自带的那个组件应该就不行了

发自我的 iPhone

在 2017年7月4日,上午10:57,angrycans notifications@github.com 写道:

有款乐视居然也可以使用这个扫码

janus j k lu notifications@github.com于2017年7月4日 周二10:55写道:

很多机型?商米不是只有几个机型么?

发自我的 iPhone

在 2017年7月4日,上午9:23,angrycans notifications@github.com 写道:

我找了下问题 如果SunmiScannerView style flex=1 或者width=Dimensions.get('window'); 时

scanner: { height: 450, justifyContent: 'center', alignItems: 'center' },

这种情况下 在很多机型上面 返回时 页面render都会不正常 只有给width=width-1 才能正常 也就是width 在camera preview 可能计算的不对

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/januslo/react-native-sunmi-inner-scanner/issues/2#issuecomment-312768542, or mute the thread https://github.com/notifications/unsubscribe-auth/AHBHYwBDAwfsnBzx6RzDWi92wmVBR4nUks5sKamngaJpZM4OMB4k .

-- 这家伙很懒 没有签名 — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

angrycans commented 7 years ago

嵌入view 也有部分机型不支持 我希望能都支持 可是有几个机型奔溃

janus j k lu notifications@github.com于2017年7月4日 周二11:34写道:

嵌入View的插件应该安卓都可以,自带的那个组件应该就不行了

发自我的 iPhone

在 2017年7月4日,上午10:57,angrycans notifications@github.com 写道:

有款乐视居然也可以使用这个扫码

janus j k lu notifications@github.com于2017年7月4日 周二10:55写道:

很多机型?商米不是只有几个机型么?

发自我的 iPhone

在 2017年7月4日,上午9:23,angrycans notifications@github.com 写道:

我找了下问题 如果SunmiScannerView style flex=1 或者width=Dimensions.get('window'); 时

scanner: { height: 450, justifyContent: 'center', alignItems: 'center' },

这种情况下 在很多机型上面 返回时 页面render都会不正常 只有给width=width-1 才能正常 也就是width 在camera preview 可能计算的不对

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/januslo/react-native-sunmi-inner-scanner/issues/2#issuecomment-312768542>,

or mute the thread < https://github.com/notifications/unsubscribe-auth/AHBHYwBDAwfsnBzx6RzDWi92wmVBR4nUks5sKamngaJpZM4OMB4k>

.

-- 这家伙很懒 没有签名 — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/januslo/react-native-sunmi-inner-scanner/issues/2#issuecomment-312772550, or mute the thread https://github.com/notifications/unsubscribe-auth/AHBHY6A3NfIICWVoaeP4e6iUkKinNKaUks5sKbLEgaJpZM4OMB4k .

-- 这家伙很懒 没有签名

januslo commented 7 years ago

亲,没条件测试

angrycans commented 7 years ago

nexus 7 的奔溃信息 你可以看看

07-04 14:34:11.614 21413 21431 E AndroidRuntime: java.lang.RuntimeException: An error occurred while executing doInBackground() 07-04 14:34:11.614 21413 21431 E AndroidRuntime: at android.os.AsyncTask$3.done(AsyncTask.java:309) 07-04 14:34:11.614 21413 21431 E AndroidRuntime: at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354) 07-04 14:34:11.614 21413 21431 E AndroidRuntime: at java.util.concurrent.FutureTask.setException(FutureTask.java:223) 07-04 14:34:11.614 21413 21431 E AndroidRuntime: at java.util.concurrent.FutureTask.run(FutureTask.java:242) 07-04 14:34:11.614 21413 21431 E AndroidRuntime: at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234) 07-04 14:34:11.614 21413 21431 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 07-04 14:34:11.614 21413 21431 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 07-04 14:34:11.614 21413 21431 E AndroidRuntime: at java.lang.Thread.run(Thread.java:818) 07-04 14:34:11.614 21413 21431 E AndroidRuntime: Caused by: java.lang.UnsupportedOperationException: unsupported image format 07-04 14:34:11.614 21413 21431 E AndroidRuntime: at com.sunmi.scan.ImageScanner.scanImage(Native Method) 07-04 14:34:11.614 21413 21431 E AndroidRuntime: at com.sunmi.scanner.SunmiInnerScannerView$AsyncDecode.doInBackground(SunmiInnerScannerView.java:175) 07-04 14:34:11.614 21413 21431 E AndroidRuntime: at com.sunmi.scanner.SunmiInnerScannerView$AsyncDecode.doInBackground(SunmiInnerScannerView.java:163) 07-04 14:34:11.614 21413 21431 E AndroidRuntime: at android.os.AsyncTask$2.call(AsyncTask.java:295) 07-04 14:34:11.614 21413 21431 E AndroidRuntime: at java.util.concurrent.FutureTask.run(FutureTask.java:237) 07-04 14:34:11.614 21413 21431 E AndroidRuntime: ... 4 more 07-04 14:34:11.615 681 692 W ActivityManager: Force finishing activity com.cashphone/.MainActivity 07-04 14:34:11.659 197 21580 I QCamera3HWI: int qcamera::QCamera3HardwareInterface::translateMetadataToParameters(const camera_metadata_t*, cam_trigger_t&): flash mode after mapping 0

januslo commented 7 years ago

@angrycans 看看现在问题是否已经解决? examples 我也做了修改

angrycans commented 7 years ago

黑屏问题 已解决 如果可能帮忙支持下其他机型

angrycans commented 7 years ago

npm install januslo/react-natvie-sunmi-inner-scanner --save 你这个是安装不了的 只能通过这个git地址安装 你最好发布npm 包

angrycans commented 7 years ago

有了新问题 如果我的应用使用SunmiScannerView 上面有个组件 会被覆盖 https://github.com/WuZhuoXuan/react-native-SPRTprint/blob/master/error4.png

januslo commented 7 years ago

@angrycans see my last update... NPM published as well.

angrycans commented 7 years ago

这住其他组件的问题解决了没啊?

janus j k lu notifications@github.com于2017年7月6日 周四18:29写道:

@angrycans https://github.com/angrycans see my last update... NPM published as well.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/januslo/react-native-sunmi-inner-scanner/issues/2#issuecomment-313359082, or mute the thread https://github.com/notifications/unsubscribe-auth/AHBHY3ym4Iy-qap82jKZourx_AGJ0w0Pks5sLLb9gaJpZM4OMB4k .

-- 这家伙很懒 没有签名

januslo commented 7 years ago

@angrycans 应该解决了,我example 里面的 absolute View 已经可以显示。

angrycans commented 7 years ago

我明天验证一下

janus j k lu notifications@github.com于2017年7月6日 周四18:34写道:

@angrycans https://github.com/angrycans 应该解决了,我example 里面的 absolute View 已经可以显示。

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/januslo/react-native-sunmi-inner-scanner/issues/2#issuecomment-313360136, or mute the thread https://github.com/notifications/unsubscribe-auth/AHBHY43io-THJFPC9VBlO0sGBaRXSop8ks5sLLhAgaJpZM4OMB4k .

-- 这家伙很懒 没有签名

januslo commented 7 years ago

@angrycans nexus 7 是那个没有后摄像头的平板?

angrycans commented 7 years ago

nexue 7 2代 有后摄像头 ,遮挡的问题他解决 nexus7 也可以正常扫码 感谢