本文介绍了如何在 iOS 上编辑 NativeScript-Angular RadDataForm UIStepper?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

NativeScript-Angular 应用程序中,我尝试设置 RadDataForms TKPropertyEditor 的样式.对于 iOS 上的步进编辑器,我想增加控件和显示值之间的距离,但我找不到访问它们的方法.

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.

我使用的是 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>

推荐答案

参考高级样式 这里的例子,你可以直接修改原生对象来设置你的元素的样式.

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

这篇关于如何在 iOS 上编辑 NativeScript-Angular RadDataForm UIStepper?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-16 05:25