如何在iOS上编辑NativeScript-Angular RadDataForm UIStepper?

时间:2019-05-20 13:33:57

标签: ios nativescript angular2-nativescript nativescript-angular nativescript-plugin

在一个NativeScript-Angular应用中,我正在尝试设置RadDataForms TKPropertyEditor的样式。对于iOS上的“步进器编辑器”,我想增加控件和显示值之间的距离,但是找不到找到它们的方法。

我正在使用nativescript-ui-dataform: 4.0.0

<TKEntityProperty tkDataFormProperty name="grade" 
    displayName="Bewertung (1 – 10)" index="1">
  <TKPropertyEditor tkEntityPropertyEditor type="Stepper">
    <TKPropertyEditorParams tKEditorParams minimum="1" maximum="10" 
      step="1"></TKPropertyEditorParams>
    <TKPropertyEditorStyle tkPropertyEditorStyle valuePosition="Left"> 
    </TKPropertyEditorStyle>
  </TKPropertyEditor>
</TKEntityProperty>

1 个答案:

答案 0 :(得分:0)

请参阅高级样式examples here,您可以直接修改本机对象以设置元素样式。

 public editorSetupStepperIOS(editor) {
    editor.valueLabel.textColor = colorDark.ios;

    const coreEditor = <UIStepper>editor.editor;
    coreEditor.tintColor = colorLight.ios;

    for (let i = 0; i < coreEditor.subviews.count; i++) {
        if (coreEditor.subviews[i] instanceof UIButton) {
            (<UIButton>coreEditor.subviews[i]).imageView.tintColor = colorDark.ios;
        }
    }
    const editorView = editor.editorCore;
    editorView.labelAlignment = TKGridLayoutAlignment.Left;
}