neoneye/SwiftyFORM

TextViewFormItem and TextFieldFormItem are misaligned

pboehm opened this issue · 5 comments

At first, thank you for your work on this great library. It works like a charm!

The only problem I've encountered using version 1.2.0 is, that instances of TextViewFormItem and TextFieldFormItem are shown in full width compared to all other form items, as you can see from the attached screenshot. This problem occurs both on iPad and iPhone.

img_0017

The code used to create the form is listed below:

    override func populate(_ builder: FormBuilder) {
        builder.navigationTitle = "Image Properties"
        builder += SectionHeaderTitleFormItem().title("Image Properties")
        builder += pickStatusFormField
        builder += starsFormField
        builder += colorFormField
        builder += titleFormField
        builder += subtitleFormField

        // ....
    }

    private lazy var titleFormField: TextViewFormItem = {
        let field = TextViewFormItem().title("Title")
        field.value = self.properties.title ?? ""
        return field
    }()

    private lazy var subtitleFormField: TextViewFormItem = {
        let field = TextViewFormItem().title("Subtitle")
        field.value = self.properties.subtitle ?? ""
        return field
    }()

Thank you for submitting this issue. I'm investigating now.

@pboehm I have updated TextViewFormItem, TextFieldFormItem and other cell classes, so that they now deal with
cellLayoutMarginsFollowReadableWidth.

You can try if the new code works for you

If you have a podfile, you can paste the following snippet as it is. I have inserted the latest commit id, so you don't have to do it.

pod 'SwiftyFORM', :git => 'https://github.com/neoneye/SwiftyFORM.git', :commit => '605506226327573158c006ac85ee2d7af65fd355'

I have made a 1.3.0 release, containing the changes.

Thank you very much for this quick response and solution! I will try it asap.

With version 1.3.1 the issue is gone. Thank you very much!