Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

287
Vistas
Button works on emulator but not on smartphone on React Native

I have had a problem for several days, I have a list of items (a list of heads) and I want to be able to take action on these items (update/ delete).

I created an item component, with an update and delete button.

item list

The Button component is a component of react native elements, I use it everywhere in my app and I have not had any problems so far.

ThemeItem.tsx

    <Container>
      <List onPress={() => onSelectTheme(theme.id)}>
        <ListItem.Content>
          <View
            style={{display: 'flex', flexDirection: 'row', marginBottom: 5}}>
            <ListItem.Title style={{fontSize: 18, fontWeight: 'bold'}}>
              {theme.name}
            </ListItem.Title>
            {isActive && (
              <Icon
                name={'check-circle'}
                color={'green'}
                style={{marginLeft: 5}}
                size={20}
              />
            )}
          </View>
        </ListItem.Content>
      </List>
      <ThemeItemIconsStyle>
        <>
          {theme.id > 1 && !isActive && (
            <Button
              onPress={() => onDelete(theme.id)}
              icon={{
                name: 'trash',
                type: 'font-awesome-5',
                size: 25,
                color: 'white',
              }}
            />
          )}
          <Button
            onPress={() => onUpdate(theme)}
            icon={{
              name: 'pen',
              type: 'font-awesome-5',
              size: 25,
              color: 'white',
            }}
          />
        </>
      </ThemeItemIconsStyle>
    </Container>

ThemeItemIconStyle

const ThemeItemIconsStyle = styled.View`
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
  padding: 15px 20px;
  background-color: white;
  width: 40%;
  height: 100%;
`;

Container

const Container = styled.View`
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  background-color: white;
`;

On emulator the behavior is the one expected but when I install the apk on my phone it does not happen absolutely.

I absolutely do not understand why my code works on emulator and not on a real phone. I assume that if on emulator there is no problem, the problem does not come from the code.

Thanks in advance for help

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

But what is the type of button? Button, TouchableOpacity, TouchableOpacityWithoutFeedback...

Also, I'd recommend to change your buttons to RectButton from react-native-gesture-handler, just to use native buttons in your application ;)

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda