react-native – React本机在android上工作非常慢
发布时间:2020-12-15 20:45:47 所属栏目:百科 来源:网络整理
导读:通过’非常慢’我的意思是,它加载一个大约5秒的过渡,尽管这只是一个简单的示例应用程序. Here is the whole app RN code 看看onPressFeed 你在运行什么版本的React Native?你在运行什么手机? 如果你在Android模拟器上运行React Native,它会非常慢.此外,如
通过’非常慢’我的意思是,它加载一个大约5秒的过渡,尽管这只是一个简单的示例应用程序.
Here is the whole app RN code 看看onPressFeed
你在运行什么版本的React Native?你在运行什么手机?
如果你在Android模拟器上运行React Native,它会非常慢.此外,如果您启用了Chrome调试,则会减慢应用程序的速度. 我在我的三星Galaxy s4设备上运行了一个相当简单的React Native应用程序,它运行得相当快(动画运行也相当顺利). 我运行的一些示例代码(带有动画的sidedrawer和主视图): _renderCancel: function(){ if (this.state.showView) { return ( this.props.view ); } else { return ; } },render: function() { var menu = <Menu closeDrawer={this.closeDrawer} navigator={this.props.navigator} modifyOnClose={this.modifyOnClose} />; return ( <Drawer ref="drawer" onClose={this.onClose} type={this.state.drawerType} animation={this.state.animation} openDrawerOffset={this.state.openDrawerOffset} closedDrawerOffset={this.state.closedDrawerOffset} panOpenMask={this.state.panOpenMask} panCloseMask={this.state.panCloseMask} relativeDrag={this.state.relativeDrag} panStartCompensation={this.state.panStartCompensation} openDrawerThreshold={this.state.openDrawerThreshold} content={menu} styles={drawerStyles} disabled={this.state.disabled} tweenHandler={this.tweenHandler} tweenDuration={this.state.tweenDuration} tweenEasing={this.state.tweenEasing} acceptDoubleTap={this.state.acceptDoubleTap} acceptTap={this.state.acceptTap} acceptPan={this.state.acceptPan} changeVal={this.state.changeVal} negotiatePan={false} side={this.state.rightSide ? 'right' : 'left'} > <View> <CustomToolBar onPress={this.openDrawer}/> {this._renderCancel()} </View> </Drawer> ); }, 这在我的设备上运行得相当快. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
推荐文章
站长推荐
- ruby-on-rails – 在Heroku上,如何部署不在git r
- PostgreSQL数据库取外部数据的扩展功能
- ruby-on-rails – Ruby 1.9与rails 2.3兼容吗?
- ruby-on-rails – 如何通过Rails实现基于websock
- 从Postgresql迁移到Postgres-XL:分布式表设计
- 哪个先执行? Form_Load事件或组件的初始化? (C
- c – 来自模板类实例化的多重继承以及对成员函数
- Redux-Saga在React工程架构之的应用实践详解
- VB 数据库开发之经典实例总结(2)
- How to install flash plugin on Ubuntu
热点阅读