Tcomb-form-native: Styling doesn't work

Created on 16 Sep 2016  路  6Comments  路  Source: gcanti/tcomb-form-native

Version

  • tcomb-form-native v0.6.1
  • react-native v0.32.0

I have set borderRadius to my field but doesn't wants to change, also added a background color but that one works. Do somebody knows what can be the issue?

textbox: {
    normal: {
      color: INPUT_COLOR,
      fontSize: FONT_SIZE,
      height: 36,
      padding: 7,
      borderRadius: 4,
      borderColor: BORDER_COLOR,
      borderWidth: 1,
      marginBottom: 5,
      backgroundColor: 'white'
    }

Most helpful comment

@vanng822 you can pass the stylesheet option per field:

options: {
  fields: {
    myField: {
      stylesheet: myStylesheet,
    }
  }
}

All 6 comments

Documentation is bad, you need to pass all stylesheets

This worked for me

import bootstrap from 'tcomb-form-native/lib/stylesheets/bootstrap.js';
var options = {
  stylesheet : bootstrap
}
override the specific stylesheet
options.stylesheet.textbox.normal = {
  color: '#fff',
  height: 36,
  padding: 7,
  borderRadius: 4,
  borderWidth: 0,
  marginBottom: 5
};

@wasa4587 This still not solve the problem I am facing. My problem is that I have many input fields which I want different height for each. Look like no way to do this? Isn't it better to also pass style per field name.

@vanng822 you can pass the stylesheet option per field:

options: {
  fields: {
    myField: {
      stylesheet: myStylesheet,
    }
  }
}

Oh, thank you @alvaromb

@BogdanHossu I don't exactly get what's your issue, can you elaborate?

Closing, please ping me @BogdanHossu if you're still experiencing problems when styling your forms.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

albertogugliotta picture albertogugliotta  路  3Comments

pocesar picture pocesar  路  4Comments

newbreedofgeek picture newbreedofgeek  路  6Comments

timdoes picture timdoes  路  4Comments

pgmemk picture pgmemk  路  4Comments