How to edit NativeScript-Angular RadDataForm UIStepper on iOS?

让人想犯罪 __ 提交于 2021-02-10 14:14:55

问题


In a NativeScript-Angular app, I’m trying to style a RadDataForms TKPropertyEditor. For the Stepper Editor on iOS I want do increase the distance between the controls and the displayed value, but I can't find a way to access them.

I'm using 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:


Refer the advanced styling examples here, you may directly modify the native object to style your element.

 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;
}


来源:https://stackoverflow.com/questions/56222066/how-to-edit-nativescript-angular-raddataform-uistepper-on-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!