Question
Please complete the application to display images with the possibility to show/hide them when the user clicks the button. There should be one button that
Please complete the application to display images with the possibility to show/hide them when the user clicks the button.
There should be one button that triggers an alert with 3 actions, that show/hide one of the images. Text should change dynamically.
import React, { Component } from 'react'; import Proptypes from 'prop-types'; import { Text, View, TouchableHighlight,, StyleSheet} from 'react-native';
export default class TouchableHighlight extends Component {
contructor() super(); this.state = { toggles: true } }
render() { let isToggle = this.state.toggle ? 'YES' : 'NO'; return (
const styles2 = StyleSheet.create({ toggle: { padding: 5 backgroundColor: '#ccc', } )
import React, { Component } from 'react'; import {Text, View, Button} from 'react-native';
const alertMessage = 'You presses the button';
export default class ButtonComponent extends Component {
constructor() super(); this.state = {
} }
btnPress(){ Alert.alert('My alert', alertMessage, [ {text: 'Cancel', onPress: () => console.log('You cancelled')}, {text: 'OK', onPress: () => console.log('You agreed')}, ]); }
render() { return(
); } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started