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

RadDataForm - iOS Layout

5 Answers 146 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 21 Apr 2019, 07:25 AM

Hi there,

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.

 

Regards,

5 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 22 Apr 2019, 07:15 AM
Hello Michael,

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:
https://docs.telerik.com/devtools/xamarin/knowledge-base/dataform-wrap-titles-editors

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:

protected override void UpdateEditor(TKDataFormEditor editor, IEntityProperty property)
{
    if(editor is TKDataFormTextFieldEditor)
    {
               
        var textField = (UITextField)editor.Editor;
        textField.Font = UIFont.SystemFontOfSize(12);
        var label = (TKLabel)editor.TextLabel;
        label.Font = UIFont.SystemFontOfSize(12);
    }
    base.UpdateEditor(editor, property);
}

I hope I was of help.

Regards,
Yana
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Michael
Top achievements
Rank 1
answered on 26 Apr 2019, 07:29 AM

Hi Yana,

 

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?

 

Regards,

Michael

0
Yana
Telerik team
answered on 30 Apr 2019, 01:33 PM
Hi Michael,

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.

Regards,
Yana
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Michael
Top achievements
Rank 1
answered on 30 Apr 2019, 02:49 PM

Hi Yana,

 

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.

 

0
Yana
Telerik team
answered on 01 May 2019, 11:21 AM
Hello Michael,

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.

Regards,
Yana
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
DataForm
Asked by
Michael
Top achievements
Rank 1
Answers by
Yana
Telerik team
Michael
Top achievements
Rank 1
Share this question
or