Skip to content
This repository has been archived by the owner on Feb 4, 2021. It is now read-only.

Cannot resize button size with width or height #74

Open
mileung opened this issue Jun 2, 2016 · 9 comments
Open

Cannot resize button size with width or height #74

mileung opened this issue Jun 2, 2016 · 9 comments

Comments

@mileung
Copy link

mileung commented Jun 2, 2016

Cannot resize button size with width or height.

<Button
            style={[styles.button, {width: 200}]}
            value={'No'}
            raised={true}
            />

var styles = StyleSheet.create({
button: {
    width: 100,
    height: 100,
    padding: 20
  }
});

Buttons do not resize for some reason. I'm pretty sure I'm doing it the wrong way, but can't seem to find any documentation on it (or the raised property).

@perjerz
Copy link

perjerz commented Jun 6, 2016

Agree with MLeung

@tarun29061990
Copy link

How to change button text font-size?

@mileung
Copy link
Author

mileung commented Jun 19, 2016

@tarun29061990 I had to fork the repo and modify the source code. There's a lot of hard code, so makes sense why you can't resize the buttons.

@tarun29061990
Copy link

tarun29061990 commented Jun 21, 2016

@mileung
Copy link
Author

mileung commented Jun 21, 2016

@tarun29061990 Thanks, that library looks like you can resize the buttons. Not sure if you can adjust fontSize though.

@jadeydi
Copy link

jadeydi commented Sep 10, 2016

It has said here: https://github.com/react-native-material-design/react-native-material-design.github.io/blob/master/components/button.md

You have to put button in a parent to resize it.

@skptricks
Copy link

Refer this post : https://www.skptricks.com/2018/07/how-customize-button-in-react-native.html

@engrrbilal
Copy link

engrrbilal commented Dec 12, 2019

In React Native you can achieve it using a Button inside a View and set the width of View
import { View, Button } from "react-native"; <View style={{ width: 200}}><Button title="Login"/></View>

@usamaabrar22
Copy link

@engrrbilal You are right.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants