I am using RadDataForm as a read-only Sheet to display certain detail information. That works pretty nice on android, but for iOS the layout makes it almost impossible to read any data (see attachment).
So my questions are:
- are there any possibities to use a line-break on iOS for long text cells?
- are there any possibilities to modify the text size. I know it is possible for the header, but it would also be needed for the value.
5 Answers, 1 is accepted
Indeed, the layout of DataForm editors is different on Android ans iOS as we tried to follow the native look & feel. In order to make the more consistent, you could implement custom renderer on iOS and arrange the fields in each editor. Here is a kb article which explains the approach in details:
As to the font size query - again in the custom renderer in the UpdateEditor method you could find the used native controls and set their font size, here is a quick sample:
I hope I was of help.
thanks for the example provided, that helped a lot.
Is there any special reason I need to set an explicit height in HeightForEditor? It is hard to estimate the correct size of an editor, because it depends on the length of the data to be shown and on the device measures. Would it also be possible, like it is done on the android version, to have a auto sized editor?
And I have to issues right now:
- when I register a custom editor for a type, like that dataForm.RegisterEditor(typeof(string), Telerik.XamarinForms.Input.EditorType.Custom), GetCustomEditorType is called once for the renderer, even though I have multiple string data to display. And no matter which Editor I return from here, the dataform always uses the default one defined for string.
When I use RegisterEditor for a property name everything works as expected.
- only on iOS I get a empty group with no header text and no editors at the end of the dataform (please see attachment). Thats not the case for android with the same data object. What could be the reason for that?
First, regarding iOS - I am afraid that's how it is implemented in the DataForm for iOS, which is wrapped in DataForm for Xamarin.Forms, the height is hard-coded, that's why you'd need to change it manually according to the editor.
As to the other issues you've pointed:
- indeed, RegisterEditor method for a type does not work properly on iOS platform. On Android it is properly called on my side, can you confirm that's the case you're observing as well?
- I would ask you to send me the DataForm definition as well as the Source object, as I have no clue what could be the reason behind this issue. Thanks in advance
I look forward to your reply.
at the time being I have not implemented a custom renderer for the dataform on android, because the default layout fits my needs so far. Therefore I cannot tell you if RegisterEditor works right there.
After doing some investigation I came to the conclusion that the empty header on iOS is displayed as soon as any property decorated by [Ignore] is defined in the dataform definition. If I comment those out the empty header is gone. Since this works on android it looks like an iOS issue with the Ignore-Attribute.
Thank you for the follow-up.
I have logged two issues on your behalf regarding RadDataForm on iOS, you could track their statuses at the links below:
- Regarding RegisterEditor method: https://feedback.telerik.com/xamarin/1407247-dataform-ios-registereditor-method-does-not-work-correctly-when-called-for-a-type
- Regarding empty header: https://feedback.telerik.com/xamarin/1407249-dataform-ios-empty-space-is-rendered-for-properties-with-ignore-attribute
You could find your points updated for bringing those to our attention.
Let me know if I can assist with anything else.