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>

最佳答案

参考高级样式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;
}

09-30 19:43