Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/435.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript NavigatorIOS转换导致图像闪烁_Javascript_Reactjs_React Native - Fatal编程技术网

Javascript NavigatorIOS转换导致图像闪烁

Javascript NavigatorIOS转换导致图像闪烁,javascript,reactjs,react-native,Javascript,Reactjs,React Native,我正在使用NavigatorIOS在带有图像标记的页面之间进行转换。在每次“向前”转换之前,所有图像都会闪烁。如何摆脱它 在模拟器和设备(iPhone 5)中的React Native 0.11.0(未在更高版本上测试)上发生 演示: 代码: var React=require('React-native'); 变量{ 评估学, 形象 航海家, 文本 可触摸不透明度, 看法 }=反应; var NavigatorRoot=React.createClass({ render(){ 返回( )

我正在使用NavigatorIOS在带有图像标记的页面之间进行转换。在每次“向前”转换之前,所有图像都会闪烁。如何摆脱它

在模拟器和设备(iPhone 5)中的React Native 0.11.0(未在更高版本上测试)上发生

演示:

代码:

var React=require('React-native');
变量{
评估学,
形象
航海家,
文本
可触摸不透明度,
看法
}=反应;
var NavigatorRoot=React.createClass({
render(){
返回(
)
},
});
var TestPage=React.createClass({
render(){
返回(
这是一个故意未设置内容样式的页面。请注意,在每次“向前”转换之前,图像都会闪烁。其他组件(如本文)不受影响。
{
这个是.props.navigator.push({
组件:TestPage,
标题:“测试页”,
});
}}
>
测试按钮
);
}
});
AppRegistry.registerComponent('reference',()=>NavigatorRoot);

这是React Native 0.14中修复的错误。升级或cherry pick。

这是React Native 0.14中修复的错误。升级或樱桃采摘

var React = require('react-native');

var {
  AppRegistry,
  Image,
  NavigatorIOS,
  Text,
  TouchableOpacity,
  View,
} = React;

var NavigatorRoot = React.createClass({
  render(){
    return (
      <NavigatorIOS
        style={{flex: 1,}}
        ref="navigator"
        initialRoute={{
          component: TestPage,
          title: 'Test Page',
        }}
      />
    )
  },
});

var TestPage = React.createClass({
  render(){
    return (
      <View >
        <Image
          style={{width: 340, height: 300,}}
          source={{uri: "http://dummyimage.com/320/300/090&text=test_image"}}
        />

        <Text >
          This is a page with intentionally unstyled content. Note that before each "forward" transition the image blinks. Other components (like this text) are not affected.
        </Text>

        <TouchableOpacity
          onPress={()=>{
            this.props.navigator.push({
              component: TestPage,
              title: 'Test Page',
            });
          }}
        >
          <View>
            <Text >TEST BUTTON</Text>
          </View>
        </TouchableOpacity>
      </View>
    );
  }
});

AppRegistry.registerComponent('reference', ()=> NavigatorRoot );