問題タブ [touchableopacity]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
1 に答える
319 参照

react-native - React-Native TouchableHighlight activates wrong button when next to each other

I have a React-Native view where I have to buttons side by side from each other.

What is happening is when I click Back, it does what it is supposed to do: console.log(-1)

However, when I click on Next, the console.log of "Back" is being activated almost 70% of the time and only 30% of the time it shows a console.log(+1)

I have no idea why this is happening. Here is a screenshot of what is rendered. Left side is what you see from the code below and the right side is what you see if I add a red border to styles.footerButtonContainer.

What is even weirder is, if I add this border, then the above issue completely disappears and the buttons act as they are supposed do.

enter image description here


Code

0 投票する
23 に答える
53675 参照

android - React ネイティブの TouchableOpacity onPress が Android で動作しない

TouchabelOpacity は iOS では正常に動作しますが、onPress メソッドは Android では動作しません。

私の反応ネイティブバージョン: 0.57.4

私のコード: