2017-09-26 59 views
1

我使用tcombreact-native建立一个形式,我的表单字段是birthDate: t.maybe(t.Date),但它似乎没有风格使用tcomb形式的本机反应本土

const formRegistration = t.struct({ 
    // other fields 
    birthDate: t.maybe(t.Date) 
}); 

enter image description here

我有还增加了config下来options

const options = { 
    fields : { 
    birthDate: { 
     label: 'Birth Date', 
     mode: 'date', 
     config: { 
      format: (date) => myFormatFunction('DD MM YYYY', date), 
      dialogMode: 'spinner' 
     } 
    } 
    } 
} 
}; 

回答

0

望着这个:https://github.com/gcanti/tcomb-form-native/blob/master/lib/stylesheets/bootstrap.js 的日期的风格在dateValue在管线196

所以这是我做过什么,根据需要设置样式:

const Form = t.form.Form; 

Form.stylesheet.dateValue.normal.borderColor = '#d0d2d3'; 
Form.stylesheet.dateValue.normal.backgroundColor = '#f0f1f1'; 
Form.stylesheet.dateValue.normal.borderWidth = 1; 

你按照同样的方式在tcomb风格等关键零部件(例如:标签:Form.stylesheet.controlLabel.normal.fontSize = 14;