how to set react native button to full width

I have tried all of the examples out there but I can not figure it out. I am using this

If I use the dimensions as the width the button width goes off screen. I would like if possible to have the logo at the very top and the form and button at the very button. this is for android only.

 const btnStyle = {
btn: {
    flex: 1,
    flexDirection: "row"
    //resizeMode: 'cover'
const ColoredRaisedButton = MKButton.coloredButton()

<ScrollView style={styles.scrollView}>
<View style={styles.container}>
    {/* Here the magic happens*/}
    <View style={styles.cardStyle}>
        <View style={styles.cardContentStyle}>
        <View style={styles.cardActionStyle}>
                <Text pointerEvents="none" style={styles.buttonText}>

const styles = {
cardStyle: {
    flex: 1,
    backgroundColor: "#ffffff",
    borderRadius: 2,
    borderColor: "#ffffff",
    borderWidth: 1,
    shadowColor: "rgba(0,0,0,.12)",
    shadowOpacity: 0.8,
    shadowRadius: 2,
    alignItems: "center",
    flexDirection: "column",
    justifyContent: "center",
    shadowOffset: {
        height: 1,
        width: 2
cardImageStyle: {
    flex: 1,
    height: 170,
    flexDirection: "row",
    resizeMode: "cover"
cardContentStyle: {
    padding: 15 //,
    // bottom:0,
    // position:'absolute',
    //justifyContent: 'flex-end'
cardActionStyle: {
    flex: 1,
    borderStyle: "solid",
    borderTopColor: "rgba(0,0,0,.1)",
    borderTopWidth: 1,
    padding: 15,
    alignItems: "center",
    flexDirection: "column",
    justifyContent: "center"
scrollView: {
    flex: 1
container: {
    flex: 1,
    alignItems: "stretch",
    backgroundColor: "#eae9e9",
    padding: 20 //,
buttonText: {
    fontSize: 14,
    fontWeight: "bold",
    color: "white"


You should remove the alignItems: 'center' from both cardStyle & cardActionStyle, then you should get a full width button.

You can use this pattern:

<View style={[{width:"100%"}]}>
        style={[{borderRadius: 5,}]}

Set Button Width and Height In React Native Lets use the below source that helps to set width and height of button. Here you need to specify the button width and height parameter in view layout.

<View style={[{ width: "90%", margin: 10, backgroundColor: "red" }]}>
      title="Button Three"

Need Your Help

indexeddb implementation in angularjs2

typescript angular indexeddb

I am looking for an implementation of indexeddb with Angularjs2. I came across this api; however I see less activity in this project currently and it does...

JSP,HTML and Javascript - Passing calculation to jsp

javascript html jsp

I need to make a simple car loan calculation using html, and pass the all the information to another jsp page. The problem is, I don't know how to pass my javascript calculation method into a form,...