iOS上绝对位置视图中的TouchableOpacity

时间:2020-04-11 15:52:33

标签: ios react-native touchableopacity

我正在构建react本机项目。 这段程式码在Android上运作良好,但在ios上却无法正常运作。 如果我触摸按钮的前半部分,它可以工作,但触摸按钮的末尾则不起作用。

      <View style={{backgroundColor: 'red', position: 'absolute', bottom: 0, alignSelf: 'center', width: 300}}>
        <TouchableOpacity onPress={()=>{console.log('clicked!');}>

          <View style={{flex: 1, backgroundColor: 'blue', width: 300}}>
            <Text style={{flex: 1, backgroundColor: 'green', width: '100%', textAlign: 'center'}}>
            Click Me!
            </Text>
           </View>

        </TouchableOpacity>
      </View>

0 个答案:

没有答案
相关问题