react-native-navigation icon indicating copy to clipboard operation
react-native-navigation copied to clipboard

custom right button problems with positioning on Android.

Open YYH123123 opened this issue 8 years ago • 6 comments

Issue Description

I am designing my own custom right button which design is like this(What I want to do): default

But this is what the result is when I am trying to implement it: default

I already follow this and refered to other issues here. I succeed in making gap between the button and the right side on IOS but I can't make it on Android. I wanna make a padding between the button and right side... Please help me and I really appreciate it.

This is code I made: Navigation.startTabBasedApp({ tabs: [ { title: 'Screen One', screen: 'connecting.VoiceTab', // unique ID registered with Navigation.registerScreen icon: require('../assets/bottom_tab_menu1.png'), // local image asset for the tab icon unselected state (optional on iOS) selectedIcon: require('../assets/bottom_tab_menu1_on.png'), // local image asset for the tab icon selected state (optional, iOS only. On Android, Use tabBarSelectedButtonColor instead) iconInsets: defineIconInsets, title: 'Connecting', navigatorStyle: defaultNavStyle, navigatorButtons: { rightButtons: [ { id: 'custom-button', component: 'connecting.PaymentButton', passProps: { text: 'Hi!', }, } ] } },

`Import React, { Component } from 'react';

import { Image, TouchableOpacity, StyleSheet, View, Text } from 'react-native';

const styles = StyleSheet.create({ button: { width: 30, height: 20, justifyContent: 'center', alignItems: 'center', }, });

export default PaymentButton = ({ text }) => <TouchableOpacity style={[styles.button]} onPress={() => console.log('pressed me!')}> <Image style={styles.button} source={require('../../assets/big_crown.png')} /> `

Please help me solve the problem...:(


Environment

  • React Native Navigation version: latest
  • React Native version: latest
  • Platform(s) (iOS, Android, or both?): Android

YYH123123 avatar May 11 '18 16:05 YYH123123

We use the issue tracker exclusively for bug reports and feature requests. This issue appears to be a general usage or support question. Instead, please ask a question on Stack Overflow with the react-native-navigation tag.

support avatar Jun 04 '18 06:06 support

same me. why close?

windydang26 avatar Jul 18 '18 10:07 windydang26

width for custom right button too small cause error

windydang26 avatar Jul 18 '18 10:07 windydang26

same issue here

LeVadim avatar Jul 18 '18 21:07 LeVadim

same issue here +1

pacozaa avatar Nov 26 '18 01:11 pacozaa

Got fix for this, ensure that you set a width on the container of the component you are passing in. I bumped it from 30-50 and all is fine.

kanso-michael avatar Nov 30 '18 14:11 kanso-michael