Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 ( {isToggle} this.setState({toggle: !this.state.toggle})}> Toggle

) } }

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( {_scrollView = scrollView}} contentContainerStyle={{padding: 30}} onContentSizeChange={(contentWidth, contentHeight) => {console.log('Height: ' + contentHeight + 'Width:') onScroll={() => console.log('You are scrolling')}}} pagingEnabled={true} > Large text Large text Large text Large text Large text Large text Large text Large text Large text Large text

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management With Website Development Applications

Authors: Greg Riccardi

1st Edition

0201743876, 978-0201743876

More Books

Students also viewed these Databases questions