Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS][ColumnSet] ChoiceSet inside ColumnSet has improper layout #5697

Merged
merged 1 commit into from
Apr 20, 2021

Conversation

akaashdev
Copy link
Contributor

@akaashdev akaashdev commented Apr 20, 2021

Related Issue

Fixed #5399

Description

  • Overriden the default padding provided by default UITableViewCell
  • Set proper frames to subviews in layoutSubviews lifecycle method

Sample Card

{
    "type": "AdaptiveCard",
    "body": [
        {
            "type": "TextBlock",
            "text": "Choose specific types:",
            "wrap": true
        },
        {
            "type": "ColumnSet",
            "columns": [
                {
                    "type": "Column",
                    "width": "stretch",
                    "items": [
                        {
                            "type": "Input.ChoiceSet",
                            "choices": [
                                {
                                    "title": "Full-time",
                                    "value": "1"
                                },
                                {
                                    "title": "Hourly",
                                    "value": "2"
                                },
                                {
                                    "title": "Agency",
                                    "value": "3"
                                }
                            ],
                            "placeholder": "Please choose employee type (All, Ford, or Agency)",
                            "id": "employee_1",
                            "isMultiSelect": true,
                            "style": "expanded",
                            "value": "0",
                            "wrap": true
                        }
                    ]
                },
                {
                    "type": "Column",
                    "width": "stretch",
                    "items": [
                        {
                            "type": "Input.ChoiceSet",
                            "choices": [
                                {
                                    "title": "Joint Venture",
                                    "value": "4"
                                },
                                {
                                    "title": "Part-time",
                                    "value": "5"
                                },
                                {
                                    "title": "New Employee",
                                    "value": "6"
                                }
                            ],
                            "placeholder": "Please choose employee type",
                            "isMultiSelect": true,
                            "id": "employee_2",
                            "wrap": true
                        }
                    ]
                },
                {
                    "type": "Column",
                    "width": "stretch",
                    "items": [
                        {
                            "type": "Input.ChoiceSet",
                            "choices": [
                                {
                                    "title": "Subsidiary",
                                    "value": "7"
                                },
                                {
                                    "title": "Supplier",
                                    "value": "8"
                                }
                            ],
                            "placeholder": "Placeholder text",
                            "isMultiSelect": true,
                            "id": "employee_3"
                        }
                    ]
                }
            ]
        }
    ],
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "version": "1.3",
    "actions": [
        {
            "type": "Action.Submit",
            "title": "Submit",
            "style": "positive",
            "id": "submit"
        }
    ]
}

How Verified

Before fix

Simulator Screen Shot - iPhone 12 Pro Max - 2021-04-20 at 14 03 24

After fix

Simulator Screen Shot - iPhone 12 Pro Max - 2021-04-20 at 14 02 09

Microsoft Reviewers: Open in CodeFlow

@ghost
Copy link

ghost commented Apr 20, 2021

CLA assistant check
All CLA requirements met.

@akaashdev akaashdev changed the title adjusted frames [iOS][ColumnSet] ChoiceSet inside ColumnSet has improper layout Apr 20, 2021
@@ -61,7 +61,7 @@ - (UIView *)render:(UIView<ACRIContentHoldingView> *)viewGroup
}

// removes leading padding
choiceSetView.contentInset = UIEdgeInsetsMake(0, -15, 0, 0);
choiceSetView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can you remove this line?

Copy link
Member

@jwoo-msft jwoo-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@jwoo-msft
Copy link
Member

@akaashdev
This change didn't cause layout conflicts, and all frame rectables (UITableCell, UITableView, ImageView and UILabel) are not overlapping, right?

@jwoo-msft jwoo-msft merged commit abb2b98 into microsoft:main Apr 20, 2021
@akaashdev
Copy link
Contributor Author

Yea that's right @jwoo-msft. It didn't cause any layout conflicts as far as I tested and it didn't cause any overlaps.

michaelfarnsworth pushed a commit to michaelfarnsworth/AdaptiveCards that referenced this pull request Nov 10, 2022
rankush pushed a commit to rankush/AdaptiveCards that referenced this pull request May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[iOS][ColumnSet] ChoiceSet inside ColumnSet has improper layout
2 participants