question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Button not working fine in android

See original GitHub issue

Hi! Thanks for trying out NativeBase! Due to the overwhelming requests and issues/questions we ask you to add the following details with your issue.

Please check the existing open/closed issues for a possible duplicate before creating a new issue 😃

Also,DO fill out the below form to give us a better idea about your environment and help us debug it quicker. Issues without the required details will mostly be unattended to.

react-native, react and native-base version

"native-base": "^2.4.1", "react": "16.3.1", "react-native": "0.55.1",

Expected behavior

screen shot 2018-04-11 at 2 54 54 pm i.e in iOS

Actual behavior

in android it looks like this screen shot 2018-04-11 at 3 01 15 pm

Steps to reproduce (code snippet or screenshot)

const ButtonNative = ({ title, icon ,onPress }) => ( <Button rounded style={styles.roleBtn} onPress={onPress}> <Left> <Icon name={icon} style={styles.roleIcon} /> </Left> <Text>{title}</Text> <Right /> </Button> );

`const styles = StyleSheet.create({ roleBtn: { marginVertical: 10, backgroundColor: “#444”, zIndex: -1000, paddingVertical: 10, paddingHorizontal: 10, fontSize: 30,

}, roleIcon: { paddingLeft: 15, fontSize: 30, color: “#fff” } });`

Screenshot of emulator/device

Is the bug present in both ios and android or in any one of them?

An android device only works fine on iOS

Any other additional info which would help us debug the issue quicker.

I tried giving left body and right to align the button full width but the text was not visible then neither the icon screen shot 2018-04-11 at 3 01 15 pm

also one more thing Please

can you tell me anyway by which the header can have the title in the center in both android and ios and not only in ios? I developed the whole code in iOS simulator but now it looks very much odd in Android, also the text field for the title is very limited it shows … after certain width.I used the native base library because of these components only. Please help as soon as possible.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
akhil-gacommented, Apr 11, 2018

@sudhirkumarojhaa use block props with <Button/>

 <Button rounded block>...</Button>
0reactions
SupriyaKalghatgicommented, Jun 4, 2018

#1852 Fixed

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android Phone Buttons Don't Work? 5 Fixes and Workarounds
1. Check if the Button Is Really Dead ... If your phone buttons are not working, there's a chance a software glitch might...
Read more >
9 Ways to Fix Home Button Not Working on Android - iMobie
Way 1. Restart Your Device ... One of the reasons your Home button is not working is that there is a minor bug...
Read more >
5 Ways to fix the home button not working on Android - Carlcare
Step 1: Switch off the phone, and long-press the power button + Volume (down) button ; Step 2: Select 'Recovery' mode ; Step...
Read more >
Home Button Not Working on Android? -Real Fixes - Dr.Fone
Whenever you encounter with Android virtual soft keys, not working problem, the first thing you should try is to force restart your phone....
Read more >
2022 Complete Guide for Android Buttons Not Working Problem
Part 2. What to do when Android Volume button stops working? · Go to Settings>Apps/ Application manager and choose the Talkback. · Select...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found