neoneye / SwiftyFORM

iOS framework for creating forms
MIT License
1.08k stars 87 forks source link

TextViewFormItem and TextFieldFormItem are misaligned #28

Closed pboehm closed 7 years ago

pboehm commented 7 years ago

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
    }()
neoneye commented 7 years ago

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

neoneye commented 7 years ago

@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'
neoneye commented 7 years ago

I have made a 1.3.0 release, containing the changes.

pboehm commented 7 years ago

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

pboehm commented 7 years ago

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