嗨,我正在努力实现scrollview
像下面的gif
链接中心
但无法这样做.以下是我的反应本机代码来实现这一点.
或者有没有任何方法可以滚动到像android这样的scrollview元素的特定索引?
任何帮助,将不胜感激.提前致谢
<ScrollView
style={[styles.imgContainer,{backgroundColor:colorBg,paddingLeft:20}]}
automaticallyAdjustInsets={false}
horizontal={true}
pagingEnabled={true}
scrollEnabled={true}
decelerationRate={0}
snapToAlignment='center'
snapToInterval={DEVICE_WIDTH-100}
scrollEventThrottle={16}
onScroll={(event) => {
var contentOffsetX=event.nativeEvent.contentOffset.x;
var contentOffsetY=event.nativeEvent.contentOffset.y;
var cellWidth = (DEVICE_WIDTH-100).toFixed(2);
var cellHeight=(DEVICE_HEIGHT-200).toFixed(2);
var cellIndex = Math.floor(contentOffsetX/ cellWidth);
// Round to the next cell if the scrolling will stop over halfway to the next cell.
if ((contentOffsetX- (Math.floor(contentOffsetX / cellWidth) * cellWidth)) > cellWidth) {
cellIndex++;
}
// Adjust stopping point to exact beginning of cell.
contentOffsetX = cellIndex * cellWidth; …
Run Code Online (Sandbox Code Playgroud) horizontalscrollview ios react-native react-native-scrollview
我正在尝试使用 ML 套件从七段显示图像中获取数字,但它无法识别图像中的数字或小数。它可以识别图像中的普通文本和数字,但不能识别七段显示图像中的文本和数字。请参阅下面的我的发现。
1.适用于普通文本和数字
2.无法识别七段显示图像中的数字
还有其他方法可以实现这一目标吗?
android text-recognition firebase seven-segment-display firebase-mlkit
我已经集成了react-native-fbsdk
库并获取了用户个人资料信息,例如除电子邮件外的姓名、中间名等
我试过了 readPermissions={["email,"public_profile","friends"]}
然后也收不到电子邮件
任何帮助,将不胜感激。
提前致谢