2017-09-26 61 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;