Questions tagged [touchablehighlight]
59 questions
1
vote
1 answer
Disable react native classes on pressing a different class in the same group
I am completely new to react, Using TouchableHighlight, I have created a class,
import React, { Component } from "react";
import { Text, View, Image, TouchableHighlight } from "react-native";
export default class ChooseProComp extends Component {
…

Rak1994
- 65
- 2
- 11
1
vote
1 answer
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…

bryan
- 8,879
- 18
- 83
- 166
1
vote
0 answers
React-Native: how to disable TouchableHighlight when scrolling during animation?
I need to disable a button when scrolling using Animated.ScrollView in react-native.
I am trying to apply something like:
disabled={this.state.scrollY._value <= 30 ? false : true}
in the props of the TouchableHighlight.
From what I have learned,…

Hesller Huller
- 11
- 2
1
vote
1 answer
Require() in react native
I work on an idea of select star and I'm stuck on a problem.
Here is my code :
export default class Star extends Component {
render() {
var starArray = [];
var i;
for (i = 0; i < 4; ++i) {
if (i <…

Eliott Robert
- 321
- 2
- 7
- 17
1
vote
1 answer
Element that listen press event inside touchable element
I have an element that listens for press events. How can I wrap this in a touchable element and have my custom element continue listening to events?
I've structure like this
{ console.log(e.nativeEvent); }}
…

Виталий Стасевич
- 11
- 2
1
vote
1 answer
How to use put an image of code xf138 in react native?
I have a TouchableHighlight, inside of it, I want to put an image exactly the same as xf138 in FontAwesome which looks like an arrow:
http://fontawesome.io/icon/chevron-circle-right/
I don't know how to display it, I tried to use Text inside of the…

spspli
- 3,128
- 11
- 48
- 75
1
vote
1 answer
React Native error: "Can't find variable: TouchableHighlight"
I'm trying to create a tic tac toe board in React Native using Expo. I'm using TouchableHighlight to make the board touchable so that I can add X's and O's. When the app is run I get the following error:
"Can't find variable: TouchableHighlight"…

Ryan Walker
- 715
- 2
- 10
- 23
1
vote
2 answers
react native TouchableHighlight have no behavior when press to open a another screen
Thanks for your reading,I am a beginner into React Native,I find a similar question title on this site, but my question is different from that.
I use TouchableHighlight to press to open a new screen,I have succeeded. But the button did not change…

user7609090
- 11
- 2
0
votes
0 answers
Why does React Native provide TouchableHighlight and TouchableOpacity instead of a more generic styled Touchable?
I'm new to React Native and I struggle to understand this design decision. Why do we have separate components to handle these trivial styling changes? Do they somehow behave differently than TouchableWithoutFeedback that we'd apply opacity to either…

Robo Robok
- 21,132
- 17
- 68
- 126
0
votes
0 answers
Changing color with event listener works on web, but not on phone
I want to change the color of a button and lauch a function when pressing it. I works on web with this code :
changeColor= event =>{
event.currentTarget.style.backgroundColor = 'salmon';
}
render(){
…

Batchounet
- 5
- 2
0
votes
1 answer
How to add styles in touchableHighlight
I am trying to add style to the touchableHighlight. Whenever I click on the screen, it selects the margin as well. Why is this happening and how may I get rid of it?
Also, there is an Icon inside the black box. I want to change the color of that…

Hossain
- 17
- 9
0
votes
1 answer
TouchableHighlight not working although using the source code from official react native documentation
I'm a new react native developer and I have an issue with TouchableHighlight where it always shows an error "Error: React.Children.only expected to receive a single React element child." in addition while I remove it is work as usual and I assume…

DVais
- 1
- 1
0
votes
1 answer
TouchableHighlight: how do I preserve the underlayColor colore after press out?
I am using TouchableHighlight for my component. After I press out the component (I dont know if this is the right name of the action) the underlay color disappear. I want…

newbie coder
- 644
- 5
- 18
0
votes
1 answer
TouchableHighlight does not work when I nested it in Modal
I used touchablehighlight in other screen (not in modal) they worked properly.But I don't understand why its doesnt work properly when I put it in modal. If I put Button, it works.
Here is a part of my code:
Please help me !
import React,{useState}…

osmos
- 3
- 1
0
votes
1 answer
Cant Use onPress() Events on Animated.View set to Position: Absolute - React Native
I made a scrollable header for an app I am building for a company. When I try to use a TouchableHighlight to trigger an onPress() event it does not register because the position key is set to 'absolute':
Ive tried the following after scouring the…

D'errah
- 29
- 1
- 4