如何在 iOS 上编辑 NativeScript-Angular RadDataForm UIStepper?
How to edit NativeScript-Angular RadDataForm UIStepper on iOS?
在 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;
}
在 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;
}