react-native : How to create Image Button

Solution

Use TouchableOpacity, Image and Styles.

Key codes

import React, { Component } from 'react'; import {         Image,     StyleSheet,        TouchableOpacity, } from 'react-native';  <TouchableOpacity     style={styles.sharebutton}     onPress={() => {this.onShare(SHARE_TO_WXTIMELINE)}} >     <Image         source={require('./res/img/wxtimeline.png')}     /> </TouchableOpacity>          

No Image, No Truth

modal-share
See Full sample codes Share to WeXin via Modal

No comments:

Post a Comment

Building the qz-l AI Chat Assistant Using Google Gemini 2.5 Flash Lite + Next.js

  Building the qz-l AI Chat Assistant Using Google Gemini 2.5 Flash Lite + Next.js Learn how qz-l.com's new AI chat assistant works usin...