Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

How do I style my json data on screen in form of table?

$
0
0

I have a screen where my data is displayed. I want to display in the form of table (The data at the bottom of screen)as shown below in screenshot.

Right now my screen looks like:

myscreen

I want it to look like this:

image

The data next to the close, high etc is some json data that I fetched from api.

My class:

let movie = ( <View  style={styles.bottomdata}><Text style={styles.text} key={item.name}>      {item.name}</Text><Text style={styles.text} key={item.open}>      OPEN {item.open}</Text><Text style={styles.text} key={item.close}>      CLOSE{item.close}</Text><Text style={styles.text} key={item.volumes}>      VOLUME{item.volumes}</Text><Text style={styles.text} key={item.low}>     LOW {item.low}</Text><Text style={styles.text} key={item.high}>      HIGH{item.high}</Text></View>)  return (<TouchableWithoutFeedback onPress={Keyboard.dismiss}><View style={styles.container}><View>{movie}</View></View></TouchableWithoutFeedback>   );}const styles = StyleSheet.create({  text: {    color: "black",    backgroundColor: "white",  },  bottomdata:  {      marginTop:400,      backgroundColor:"black",  }});

The movie is the data displayed on the screen. How do I design it like that? And, at the top it is just the symbol name (same as at the bottom) and close and high values. How can I design my screen like that? I am able to fetch the data but not sure how to design it like that.


Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>