This is a migrated thread and some comments may be shown as answers.

DataForm: how to set editor with transparent backgroundcolor in iOS?

3 Answers 70 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Marc
Top achievements
Rank 1
Marc asked on 15 Nov 2017, 03:27 PM

Hello,

I try to set the backgroundColor of our EntityProperties to transparent, the dataForm should just have the same backgroundColor as the page. On Android, this works without any changes. But on iOS, the DataForm has always white background. I tried to set the fillColor to "transparent", but this has no effect.

I am not able to set the fillColor to the backgroundColor of the page in XML as a hardcoded value, because we use the nativescript-themes plugin to switch between multiple color templates during runtime.

 

3 Answers, 1 is accepted

Sort by
0
Nick Iliev
Telerik team
answered on 20 Nov 2017, 08:33 AM
Hello Marc,

I can confirm that this setting the editors fillColor to transparent is not possible at this very moment. I have logged this one as a bug in this issue and also upvoted
the issue with a reference to this ticket. You can track the issue for possible updates regarding the fix.

Meanwhile, the one option to resolve your case would be to dynamically change the
fill color of your editors when changing the main theme so they can match the background color.
To achieve that you can use the fillColor property as shown in this documentation section.

For example:
Layout file (XML)
<df:RadDataForm source="{{ employee }}" editorUpdate="dfEditorUpdate" />

Code behind file (TypeScript)
export function dfEditorUpdate(args: DataFormEventData) {
    var entityProperty = <EntityProperty>(<RadDataForm>args.object).getPropertyByName(args.propertyName);
    entityProperty.editor.propertyEditorStyle.fillColor = "LightBlue";
}


Regards,
Nikolay Iliev
Progress Telerik
Did you know that you can open private support tickets which are reviewed and answered within 24h by the same team who built the components? This is available in our UI for NativeScript Pro + Support offering.
0
Imran
Top achievements
Rank 1
answered on 02 Feb 2018, 04:24 AM

I was successful in achieving this by setting "fillColor" property of "PropertyEditorStyle", we can control Alpha Index (first two digits after #). Check example code below.

<TKEntityProperty tkPropertyGroupProperties name="link" displayName="" hintText="Link"
index="4">
<TKPropertyEditor tkEntityPropertyEditor type="Label" color="White">
<TKPropertyEditorStyle tkPropertyEditorStyle strokeColor="#00695c" strokeWidth="2" fillColor="#0000FFFF" labelHidden="true"
labelTextSize="12" ios:labelFontName="Times New Roman" android:labelFontName="sans-serif-light"
labelFontStyle="Bold" labelPosition="Top" labelWidth="60" labelTextColor="#00695c" editorVerticalOffset="0"
labelVerticalOffset="0"></TKPropertyEditorStyle>
</TKPropertyEditor>
</TKEntityProperty>

0
Nick Iliev
Telerik team
answered on 02 Feb 2018, 06:22 AM
Hello Mark,

Thank you very much for sharing the workaround - indeed great find and easy solution!
I have logged the workaround in the linked issue so it would be visible to the community.

Regards,
Nikolay Iliev
Progress Telerik
Did you know that you can open private support tickets which are reviewed and answered within 24h by the same team who built the components? This is available in our UI for NativeScript Pro + Support offering.
Tags
DataForm
Asked by
Marc
Top achievements
Rank 1
Answers by
Nick Iliev
Telerik team
Imran
Top achievements
Rank 1
Share this question
or