css - How to add buttons grid style in React Native? -


i placed hands on react-native , trying add buttons dynamically view. have structure like:

( in bootstrap add class col-md-4 )

[a] [a] [a] [a]  [a] [a] [a] [a]   [a] [a] [a] [a]  

i can add the buttons appear in new line.

ie

[a] [a] [a] 

the added style , function have far:

const styles = stylesheet.create({     container: {         margintop: 65,         flex: 1,     }, })  render(){     return (         <view style={styles.container}>             {this.renderbuttons()}         </view>     ) } renderbuttons(){     var list = myarray.map((item, index) => {         return (             <view key={index}>                 <touchablehighlight                     style={styles.button}>                 </touchablehighlight>             </view>         )     })     return list; } 

i know should add style view under renderbuttons don't know start. yet.

the correct way use flexwrap: "wrap" in styles.


Comments