ReactNative Touchableopacity,触摸释放时延迟不透明度重置

时间:2017-02-14 15:46:16

标签: android react-native opacity touchableopacity

使用TouchableOpacity和下面的代码有问题。 当我按下并释放“按钮1”时,不透明度需要几秒钟才能恢复正常;此外,似乎整个应用程序的渲染停止,因为如果我旋转我的设备,屏幕不会重新布局,直到几秒钟后。 但是如果我按下并释放“按钮2”,则不透明度立即恢复正常。

有谁请让我知道我该怎么做才能解决这个问题?

感谢。

class someComponent extends Component {
   buttonPressed() {console.log(arguments);}

   render() {
       // something
       return (
           <View style={styles.container1}>
               <TouchableOpacity onPress={this.buttonPressed}>
                   <Text style={styles.button}>Button1</Text>
               </TouchableOpacity>
               <TouchableOpacity onPress={()={console.log(arguments);}}>
                   <Text style={styles.button}>Button2</Text>
               </TouchableOpacity>
           </View>);}

用于测试的设备:三星GSII:Android 4.1.2,(部分平板电脑):Android 4.1.1

0 个答案:

没有答案