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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MOB-7748] iOS constraints fix for banner img view #742

Merged
merged 2 commits into from
Jan 30, 2024

Conversation

Ayyanchira
Copy link
Member

@Ayyanchira Ayyanchira commented Jan 29, 2024

馃敼 Jira Ticket(s)

鉁忥笍 Description

Please provide a brief description of what this pull request does.

鈥淎kshay added 2 commits January 29, 2024 14:32
Placing a `less than equal to` constraint so that when image is not present, the nil image can provide its width for stackview beside it
Image in banner view to have constant width of 100 if its available. If not, the flexible constraint view can shrink the size of imgView making it available to stackview when image is not present
@Ayyanchira
Copy link
Member Author

Ayyanchira commented Jan 29, 2024


Card View



Notification View



Banner View


Current implementation

@@ -66,7 +66,7 @@ Description text</string>
<rect key="frame" x="268" y="0.0" width="100" height="100"/>
<constraints>
<constraint firstAttribute="height" constant="100" id="8cm-im-EKi"/>
<constraint firstAttribute="width" constant="100" id="bVg-Ev-iLm"/>
<constraint firstAttribute="width" relation="lessThanOrEqual" constant="100" id="bVg-Ev-iLm"/>
Copy link
Member Author

Choose a reason for hiding this comment

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

This is now the default behavior allowing Label and text to have more horizontal space when image is not available.

@@ -299,6 +299,9 @@ public class IterableEmbeddedView:UIView {
imgView.isHidden = EMimage == nil
imgView.isHidden = self.EMimage == nil
imgView.image = EMimage
if !imgView.isHidden {
imgView.widthAnchor.constraint(equalToConstant: 100).isActive = true
Copy link
Member Author

Choose a reason for hiding this comment

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

This overrides the behavior by placing a constant 100 width for banner images if they are available

Copy link
Contributor

@evantk91 evantk91 left a comment

Choose a reason for hiding this comment

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

LGTM

@evantk91 evantk91 merged commit 7f99c89 into embedded-no-diff-merge Jan 30, 2024
2 checks passed
@evantk91 evantk91 deleted the MOB-7748-iOS-Constraint-fix-imgView branch January 30, 2024 16:00
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.

None yet

3 participants