![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
RN
知道分子
想要到达明天,现在就要启程
展开
-
RN使用setNativeProps渲染
在React-Native里面,如果要改变组件的样式可以通过state 或者 props来做到。但有些时候由于性能瓶颈,不得不放弃通过触发render的方式来改样式,而是通过setNativeProps 来直接更改原生组件的样式属性 来达到相同的效果。如下图:header渐变效果上图中的header渐变和搜索框出现都是直通过setNativeProps来实现的。因为header要响应滚动事件,如果...转载 2018-06-11 15:16:21 · 714 阅读 · 0 评论 -
RN的局部刷新
转自:https://blog.csdn.net/que_li/article/details/52872479ref属性不只是string ref属性不仅接受string类型的参数,而且它还接受一个function作为callback。这一特性让开发者对ref的使用更加灵活。render() { return <TextInput ref={(c) => this._inp...转载 2018-06-11 17:52:11 · 2665 阅读 · 0 评论