react-native-ios 相关问题

React-native-ios:指与react-native ios开发相关的所有内容。 react-native ios中的组件,样式,路由和本机API访问。

React Native 设置默认 iPhone 模拟器

我想为我的 React Native 项目设置一个默认模拟器,所以如果我运行脚本 yarn ios 或 npx react-native run-ios 它总是启动“iPhone 12 Pro Max”。 使用 --simulator f...

回答 3 投票 0

使用react-native-router-flux删除抽屉页面的后退按钮

我一直在尝试创建一个应用程序来学习 React Native,它有一个登录界面,在成功验证后,用户将被重定向到带有导航抽屉的主页 - 标准...

回答 4 投票 0

今天与 Swift 共享钥匙串反应本机小部件

我们有一个react-native应用程序,它以这种方式使用react-native-keychain库(就像本期一样): 从“react-native-keychain”导入*作为钥匙串; 尝试 { 钥匙扣。

回答 2 投票 0

iOS 键盘自动填充在关注下一个 TextInput 时会导致内容跳转/故障

描述 我的应用程序中有一个页面,其中两个 TextInput 内部视图覆盖整个屏幕。 两个TextInput有一个ref ref={refTextInput1}, ref={refTextInput2}。 他们还有一个 onSubmitEditing

回答 1 投票 0

react-native webview 加载指示器

我试图在网络中显示加载指示器,如下所示。显示正在加载指示器,但页面加载后显示白色背景。如果我将 startInLoadingState 更改为 false,网络连接...

回答 12 投票 0

如何在ios stimulator中查看react-native创建的realm db

我想访问我使用react-native创建的ios应用程序创建的领域数据库。对于 android 使用 adb pull 更容易,但对于 ios 我不太了解。有一些链接,例如 - ...

回答 3 投票 0

React Native,使用纵向模式检测屏幕旋转变化

我在反应本机应用程序中使用纵向模式。但我想捕获屏幕的旋转事件。 有没有办法做到这一点? 谢谢...

回答 6 投票 0

如何开始使用react-native-bootsplash

我想使用react-native-bootsplash制作闪屏。我已按照 npm 上的说明进行操作,并且该库已正确安装,但我无法理解如何使用它。有人可以吗...

回答 2 投票 0

配置项目':react-native-audio-recorder-player'时出现问题>未指定compileSdkVersion,同时运行react-native run-android

每当我尝试运行react-native run-android时,我都会收到以下错误: 配置项目“:react-native-audio-recorder-player”时出现问题。 > 未指定compileSdkVersion...

回答 4 投票 0

创建React Native项目时如何定义自己的包名称/包标识符

当我在 React Native 中创建新应用程序时,可以给我一些建议如何定义自己的包名称/包标识符吗? 我使用命令 npx react-native MyApp --package=com.myCompany.myApp o...

回答 3 投票 0

ImageBackground 没有占据 React Native 中视图的完整高度

我在我的 React Native 应用程序中使用 ImageBackground,但它没有覆盖视图的整个高度 你可以看到有红色空间没有被我的图像覆盖。 下面是我的代码: 我在我的 React Native 应用程序中使用 ImageBackground,但它没有覆盖 View 的整个高度 你可以看到有红色空间没有被我的图像覆盖。 下面是我的代码: <View style={styles.subDomainItem}> <ImageBackground resizeMode={'cover'} source={ImageConfig.script_default_cloud} style={{ width: '100%', height: (dimensions.width - 20) / 2, backgroundColor: 'red', flex: 1, justifyContent: 'center', }}></ImageBackground> </View> subDomainItem: { maxWidth: '94%', width: '94%', marginHorizontal: '3%', marginVertical: 10, overflow: 'hidden', borderRadius: 10, flex: 1, elevation: 8, }, 我希望我的图像覆盖顶部和底部的所有红色空间,但我不知道我做错了什么。 试试这个。工作正常 import React from 'react' import { View, ImageBackground,Text, Dimensions } from 'react-native' const Backimage = () => { return( <ImageBackground style={{width:Dimensions.get("screen").width, height:Dimensions.get("screen").height}} source={require("./src/assets/water.png")} resizeMethod="resize"> </ImageBackground> ) } export default Backimage 我认为你应该在设置 subDomainItem 视图的样式时给它一个明确的高度。您指定了 94% 的宽度,但没有指定高度。 如果父组件(本例中为 subDomainItem)具有明确的高度,则 ImageBackground 应该可以正常工作,将其高度设置为 100%。 如果你想覆盖父视图的所有空间,你不想给 ImageBackground 提供高度和宽度,你只需要为 ImageBackground 提供 flex: 1 或高度和宽度为 100%。 import { View, Text, ImageBackground, Dimensions, StyleSheet, } from 'react-native'; const WIDTH = Dimensions.get('screen').width; const HEIGHT = Dimensions.get('screen').height; const MainPage = () => { return ( <View style={styles.subDomainItem}> <ImageBackground resizeMode="contain" source={ImageConfig.script_default_cloud} style={styles.bgImageStyle} > <Text>Sample</Text> </ImageBackground> </View> ); }; const styles = StyleSheet.create({ subDomainItem: { width: WIDTH, height: HEIGHT, alignItems: 'center', }, bgImageStyle: { justifyContent: 'center', resizeMode: 'contain', width: WIDTH, height: HEIGHT, } }) 如果状态栏的样式是自动,那么您需要将该高度添加到尺寸中,以便您可以获得任何屏幕尺寸的屏幕高度 从 'react-native' 导入 { Dimensions, StatusBar } const HEIGHT = Dimensions.get("window").height + StatusBar.currentHeight; 然后在程序中使用它就像

回答 4 投票 0

pod 在 macOS Big sur 上安装失败

我对 macOS 很陌生,最近从 Windows 转移到 macOS,我开始开发 React-Native 应用程序,当我尝试 React-Native Run-ios 时,它给了我以下错误 错误找不到“Po...

回答 9 投票 0

不变违规:“RNSVGSvgView”的本机组件不存在

经过几天在互联网上的研究,我仍然没有解决我的问题。 我正在使用react-native-svg并且遇到同样的问题: 未找到名为“RNNSVGPath”的视图组件 或者...

回答 6 投票 0

无法登录expo React Native

我正在尝试发布我的 React Native Expo 应用程序。所以我尝试的是使用命令 exp login 但我得到的是 需要输入,但 exp 处于非交互模式。 所需输入: > 用户...

回答 2 投票 0

如何在 TextInput 中按“Enter”键调用函数 - React Native

我正在尝试制作搜索栏。我希望用户在 TextInput 中输入一些内容,当用户按“Enter”时我想调用我的函数。 我正在尝试制作搜索栏。我希望用户在 TextInput 中输入一些内容,当用户按“Enter”时,我想调用我的函数。 <TextInput //here when user press enter call function() style={styles.searchStyle} allowFontScaling={false} placeholder="Search" onChangeText={(val) => {setSearch(val)}} /> 我尝试过onSubmitEditing但没用。 import React, { Component } from 'react' import {TextInput} from 'react-native' const Trial = () => { const onSubmitted = () => { console.log('Submitted') } return( <TextInput //here when user press enter call function() // style={styles.searchStyle} allowFontScaling = {false} placeholder = "Search" onSubmitEditing = {() => onSubmitted()} /> ) } export default Trial onSubmitEditing 效果很好,希望对您有帮助 如果您在 TextInput 中使用 mutiline={true} ,如 <TextInput multiline={true} /> onSubmitEditing 将不起作用,而是会移至下一行。 我正在做一个解决方法,所以基本上我检查用户是否输入了下一行,如果是,则调用提交函数并关闭键盘,您可以从react-native导入{Keyboard} <TextInput onChangeText={(txt) => { if (/\n/.test(txt)) { //call submit function here Keyboard.dismiss() return } else { //do something here } }} />

回答 2 投票 0

Xcode 构建失败如果我将上传调试符号添加到哨兵脚本

如果我将上传调试符号添加到哨兵,则无法构建应用程序。也在 Xcode 中显示 在后台继续 无法显示 Xcode 通知 导出 SENTRY_PROPERTIES=sentry.proper...

回答 1 投票 0

警告:尝试在已经呈现的 <UINavigationController> 上呈现 <RNNSideMenuController> <RCTModalHostViewController>

我正在使用应用内支付-react-native-plugin插件将Square支付方法集成到react native中。在 iOS 中,如果在添加新卡反应本机 p 上打开卡输入模型,则会产生问题...

回答 1 投票 0

xcodebuild:错误:名为“app”的工作区不包含名为“app”的方案

我正在开发一个 React Native 应用程序,我正在从 0.59 升级到 0.60。我已经整理好了 cocoapods,并且可以在模拟器中成功地从 Xcode 构建并运行该应用程序。然而,当我尝试...

回答 3 投票 0

ios 键盘覆盖了位于屏幕底部的输入

ios 键盘覆盖了位于屏幕底部的输入。怎么解决这个麻烦呢? 这是代码。 ... ios 键盘覆盖了位于屏幕底部的输入。怎么解决这个烦恼呢? 这是代码。 <Content style={styles.content}> <Form> <Item style={{borderBottomColor:'#42e8f4'}}> <Icon active name='mail' style={{color: '#42e8f4'}} /> <Input placeholder='Email'placeholderTextColor= '#42e8f4' style={{color:'#0dc49d'}}/> </Item> <Item style={{ borderBottomColor:'#42e8f4'}}> <Icon active name='lock' style={{color: '#42e8f4'}} /> <Input secureTextEntry={true} placeholder='Password'placeholderTextColor= '#42e8f4' style={{color:'#42e8f4'}}/> </Item> </Form> <ListItem style={{borderBottomWidth:0,borderTopWidth:0,borderBottomColor:'#42e8f4'}}> <Button transparent onPress={() => this.props.navigation.navigate("Signup")}> <Text style={{color:'#42e8f4'}}>Create Account</Text> </Button> <Button transparent onPress={() => this.props.navigation.navigate("Forgetpass")}> <Text style={{color:'#42e8f4'}}>Forget Password</Text> </Button> </ListItem> <Button full style={{backgroundColor:'#42e8f4'}} onPress={() => this.props.navigation.navigate("Welcome")}> <Text style={{color: '#FFF'}}>Sign In</Text> </Button> </Content> const styles = { content:{ position:'absolute', bottom:10, left:0, right:0 }, } 我正在使用 Native-Base。这个问题如何解决? 查看文档 React Native Keyboard 避免视图。 是一个解决视图常见问题的组件 移开虚拟键盘。它可以自动 根据位置调整其位置或底部填充 键盘。 来自如何让你的 React Native 应用在键盘弹出时优雅响应文章中的示例 return ( <KeyboardAvoidingView style={styles.container} behavior="padding" > <Image source={logo} style={styles.logo} /> <TextInput placeholder="Email" style={styles.input} /> <TextInput placeholder="Username" style={styles.input} /> <TextInput placeholder="Password" style={styles.input} /> <TextInput placeholder="Confirm Password" style={styles.input} /> <View style={{ height: 60 }} /> </KeyboardAvoidingView> ); 您可以使用这个库react-native-keyboard-aware-scroll-view只需将其作为组件的容器 这是我的解决方案,适用于 ios 和 android : return ( <ScrollView contentContainerStyle={{ flexGrow: 1 }}> <KeyboardAvoidingView behavior={Platform.OS === "ios" ? "padding" : ""} style={styles.container}> ........ // Your input fields ........ </KeyboardAvoidingView> </ScrollView> ) const styles = StyleSheet.create({ container: { flex: 1 }, }); 带有填充的键盘避免视图隐藏了以下代码中用于此用途的按钮 <KeyboardAvoidingView behavior={"height"} style={{flex: 1}> <ScrollView contentContainerStyle={{ flexGrow: 1 }}> ........ </ScrollView> </KeyboardAvoidingView> 对我有用: 在项目导航器中选择 info.plist 右键单击顶部的“信息属性列表”,选择“添加行” 从下拉列表中选择“启动屏幕界面文件基本名称”。 将类型设置为“String”。 我将“LaunchScreen”(不带引号)作为值。 当您使用 ScrollView 并且每次单击输入时都会添加额外的填充时的解决方案: <KeyboardAvoidingView behavior={Platform.OS === "ios" ? "padding" : undefined} style={{flex: 1}> <ScrollView contentContainerStyle={{ flexGrow: 1 }}> ........ </ScrollView> </KeyboardAvoidingView>

回答 6 投票 0

如何摆脱“CocoaPods 找不到 pod 的兼容版本”?我尝试更新 cocoapod 和 pod repo

在我的react-native项目中,我想更新所有依赖项,因此我运行以下命令: 1.要更新到所有软件包的新主要版本,请安装 npm-check-updates 软件包 gl...

回答 2 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.