invertase / react-native-material-design

React Native UI Components for Material Design
http://react-native-material-design.github.io
MIT License
3.15k stars 365 forks source link

Cannot resize button size with width or height #74

Open mileung opened 8 years ago

mileung commented 8 years ago

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 commented 8 years ago

Agree with MLeung

tarun29061990 commented 8 years ago

How to change button text font-size?

mileung commented 8 years ago

@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 commented 8 years ago

@MiLeung What about this https://github.com/xinthink/react-native-material-kit?

mileung commented 8 years ago

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

jadeydi commented 8 years ago

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 commented 6 years ago

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

engrrbilal commented 4 years ago

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 commented 4 years ago

@engrrbilal You are right.