问题
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