标签: react-native-ios

React Native - React Native Architecture

React Native Application Development 是否可以通过MVC,MVP,MVVM等软件架构实现?

谢谢.

architecture react-native react-native-android react-native-ios

12
推荐指数
1
解决办法
6781
查看次数

如何使用Spinner在FlatList中添加更多记录反应本机(意味着-10 - 10条记录)手动!不是从使用服务器端

嗨,我正在开发基于FlatList的示例应用程序,这是我的代码.实际上我显示了整个记录,比如我有50条记录到我的账户.但现在我显示了整整50条记录.Bur我需要在添加10条记录后显示10.但我不知道添加到FlatList.

这是我的代码:

<FlatList
                    data={this.state.profiles}
                    renderItem={({ item, index }) => this.renderCard(item, index)}
                    keyExtractor={item => item.id}
                    ItemSeparatorComponent={() => <Divider style={{ marginTop: 5, marginLeft: width * 0.2 + 20 }} parentStyle={{ backgroundColor: globalStyles.BG_COLOR, alignItems: 'baseline' }} />}
                />


renderCard (profile, index) {
    console.log('rendercard', profile);
    //
    return (
        <View key={profile.id}>
            <ProfileCard
                profile={profile}
                style={styles.card}
                onPress={() => this.props.screenProps.rootNavigation.navigate('Profile', { profile: this.state.profile, id: profile.id })}
                // onPress={() => alert('PROFILE')}
                onAddClick={() => this.setState({ connectionPageVisible: true, cardProfile: profile })}
                connectedIds={(this.props.screenProps && this.props.screenProps.connectedIds) || this.props.connectedIds}
            />
        </View>
    );
}
Run Code Online (Sandbox Code Playgroud)

请告诉我使用活动指标加载更多记录.提前致谢

react-native react-native-android react-native-ios react-native-flatlist

12
推荐指数
1
解决办法
8873
查看次数

Xcode 10存档构建失败

我在尝试存档应用时遇到以下错误.知道如何解决这个问题吗?

:-1:多个命令产生'/Users/gb/Library/Developer/Xcode/DerivedData/GB-ggeaxhzkqxunxvenbvbwxczukaqb/Build/Intermediates.noindex/ArchiveIntermediates/GB/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libyoga.a':1)Target' yoga'有输出命令'/Users/gb/Library/Developer/Xcode/DerivedData/GB-ggeaxhzkqxunxvenbvbwxczukaqb/Build/Intermediates.noindex/ArchiveIntermediates/GB/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libyoga.a'2)目标'瑜伽'有一个带输出的命令'/Users/gb/Library/Developer/Xcode/DerivedData/GB-ggeaxhzkqxunxvenbvbwxczukaqb/Build/Intermediates.noindex/ArchiveIntermediates/GB/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libyoga.a'

:-1:多个命令产生'/Users/gb/Library/Developer/Xcode/DerivedData/GB-ggeaxhzkqxunxvenbvbwxczukaqb/Build/Intermediates.noindex/ArchiveIntermediates/GB/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libReact.a':1)Target' React'有一个带输出的命令'/Users/gb/Library/Developer/Xcode/DerivedData/GB-ggeaxhzkqxunxvenbvbwxczukaqb/Build/Intermediates.noindex/ArchiveIntermediates/GB/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libReact.a'2)target'React '有一个带输出的命令'/Users/gb/Library/Developer/Xcode/DerivedData/GB-ggeaxhzkqxunxvenbvbwxczukaqb/Build/Intermediates.noindex/ArchiveIntermediates/GB/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libReact.a'

react-native react-native-ios xcode10

12
推荐指数
1
解决办法
3998
查看次数

我可以使用prop nativeID在本机代码中查找View

是否可以将prop添加nativeID到如下视图中: <View nativeID="viewId">...</View> 然后使用该id在我的原生android和iOS代码中查找视图,以便我可以在其上应用一些本机方法.如果它是一个例子将不胜感激.

react-native react-native-android react-native-ios

12
推荐指数
1
解决办法
171
查看次数

React Native Vector图标不适用于当前版本0.60

反应本机自动链接不适用于反应本机矢量图标。我使用此https://github.com/oblador/react-native-vector-icons/issues/1035将其修复为android

但是在IOS上,我仍然面临问题。请让我知道是否有人解决了此问题...谢谢!

这是我面临的问题的屏幕截图。

在此处输入图片说明

reactjs react-native react-native-ios react-native-vector-icons

12
推荐指数
1
解决办法
4275
查看次数

如何在本机中加密和解密文本?

我需要在AsyncStorage中存储安全信息,

所以请任何人解释如何加密和解密文本in react native

react-native react-native-android react-native-ios

11
推荐指数
1
解决办法
2万
查看次数

React Native:使用项目分隔符在水平 FlatList 中正确滚动

反应原生: v0.52.0

平台: iOS

我的FlatList代码:

<FlatList
  horizontal
  pagingEnabled={true}
  showsHorizontalScrollIndicator={false}

  legacyImplementation={false}

  data={this.props.photos}
  renderItem={item => this.renderPhoto(item)}
  keyExtractor={photo => photo.id}

  ItemSeparatorComponent={this.itemSeparatorComponent}
/>
Run Code Online (Sandbox Code Playgroud)

项目分隔符代码:

itemSeparatorComponent = () => {
    return <View style = {
        {
            height: '100%',
            width: 5,
            backgroundColor: 'red',
        }
    }
    />
}
Run Code Online (Sandbox Code Playgroud)

最后是FlatList项目组件:

renderPhoto = ({ item, index }) => {
    return (
        <View style = {{ width: SCREEN_WIDTH, height: 'auto' }}>
          <FastImage 
            style = { styles.photo }
            resizeMode = { FastImage.resizeMode.contain }
            source = {{ uri: …
Run Code Online (Sandbox Code Playgroud)

horizontal-scrolling react-native react-native-ios react-native-flatlist

11
推荐指数
2
解决办法
3万
查看次数

11
推荐指数
2
解决办法
8790
查看次数

React Native iOS 构建失败,“多个命令产生”错误

我们正在开发一个 React Native 项目。我的一名团队成员在 Linux 和链接的 android 上添加了一些本机模块。到那时,我正在尝试链接 iOS 中的内容,但构建总是因这种错误跟踪而失败。Android 项目正在正常构建。

我删除xyz.xcworkspacePodfile.lock再尝试pod install
另外,我想删除我的node_modules,然后yarn install后面yarn link

react-native-cli: 2.0.1  
react-native: 0.61.4  
yarn 1.19.1
Pod 1.8.4
XCode Version 11.2.1 (11B500)
macOS Catalina 10.15.1 (19B88)
Run Code Online (Sandbox Code Playgroud)

xyz 警告

duplicate output file '/Users/user/Library/Developer/Xcode/DerivedData/xyz-hhesslamjsqmbobykhskliclusph/Build/Products/Debug-iphonesimulator/xyz.app/AntDesign.ttf' on task: PhaseScriptExecution [CP] Copy Pods Resources /Users/faisal/Library/Developer/Xcode/DerivedData/xyz-hhesslamjsqmbobykhskliclusph/Build/Intermediates.noindex/xyz.build/Debug-iphonesimulator/xyz.build/Script-47F818C57EEC47EA3303EA1B.sh
Run Code Online (Sandbox Code Playgroud)

xyz 工作区错误

Multiple commands produce '/Users/user/Library/Developer/Xcode/DerivedData/xyz-hhesslamjsqmbobykhskliclusph/Build/Products/Debug-iphonesimulator/xyz.app/Zocial.ttf':
1) Target 'xyz' (project 'xyz') has copy command from '/Users/user/Desktop/xyz/native/node_modules/react-native-vector-icons/Fonts/Zocial.ttf' to '/Users/user/Library/Developer/Xcode/DerivedData/xyz-hhesslamjsqmbobykhskliclusph/Build/Products/Debug-iphonesimulator/xyz.app/Zocial.ttf'
2) That command depends …
Run Code Online (Sandbox Code Playgroud)

xcode android ios react-native react-native-ios

11
推荐指数
4
解决办法
7771
查看次数

错误:预期节点为 ["Statement"] 类型,但得到了 "AssignmentExpression" | 反应本机 IOS

尝试在 ios 模拟器上运行本机应用程序时遇到此问题。我实际上只是创建了正在运行的项目npx react-native init app_test,当我运行时出现npx react-native run-ios了这个错误。

在此处输入图片说明

我没有安装依赖项或 pod 或任何东西。仅yarn start在应用程序初始化完成并尝试运行模拟器时运行。有什么建议吗?

控制台中的错误: error: node_modules/react-native/Libraries/Image/ImageAnalyticsTagContext.js: Property body[6] of BlockStatement expected node to be of a type ["Statement"] but instead got "AssignmentExpression"

react-native-ios

11
推荐指数
1
解决办法
1095
查看次数