Change alignment between textLabel and valueField

2 posts, 0 answers
  1. yahya
    yahya avatar
    3 posts
    Member since:
    Mar 2016

    Posted 10 Apr Link to this post

    i need to change alignment textLabel to right, and set the field of value on left.

    This user interface way used for arab user.

    i'm tired for change the frame or anything like this in dataForm between them.

    The attached image said what i need exactly, Thank You.

  2. Adrian
    Adrian avatar
    160 posts

    Posted 14 Apr Link to this post


    I apologize for the late reply.
    TKDataForm doesn't support right to left layout out of the box, however this can be easily achieved by manually arranging the views in the editors. You can see an example of manual arrangement in the Alignment example in our TelerikUIExamples application. The code below shows how to arrange the views like in the attached screenshot:
    - (void)performRightToLeftSettingsForEditor:(TKDataFormEditor *)editor property:(TKEntityProperty *)property
    { = nil;
        editor.textLabel.font = [UIFont systemFontOfSize:15]; = UIEdgeInsetsMake(1,, 5,;
        TKGridLayout *gridLayout = editor.gridLayout;
        TKGridLayoutCellDefinition *editorDefinition = [gridLayout definitionForView:editor.editor];
        editorDefinition.row = @0;
        editorDefinition.column = @1;
        TKGridLayoutCellDefinition *titleDefinition = [gridLayout definitionForView:editor.textLabel];
        titleDefinition.row = 0;
        titleDefinition.column = @2;
        titleDefinition.alignment = TKGridLayoutAlignmentRight | TKGridLayoutAlignmentCenterVertical;
        if ([ isEqualToString:@"dateOfBirth"]) {
            TKDataFormDatePickerEditor *dateEditor = ((TKDataFormDatePickerEditor *)editor);
            TKGridLayoutCellDefinition *labelDef = [gridLayout definitionForView:dateEditor.editorValueLabel];
            labelDef.row = @0;
            labelDef.column = @1;
        [self setEditorStyle:editor];

    I hope this helps.

    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
  3. DevCraft banner
Back to Top