Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions samples/v1.1/Tests/Column.VerticalAlignment.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "Container",
"items": [
{
"type": "TextBlock",
"text": "**Columns Vertical Alignment Test**",
"horizontalAlignment": "Center"
}
],
"style": "emphasis",
"bleed": true
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "Image",
"altText": "",
"url": "https://adaptivecards.io/content/adaptive-card-50.png",
"horizontalAlignment": "Center"
}
]
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "Top",
"horizontalAlignment": "Center",
"wrap": true
}
]
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "Center"
}
],
"verticalContentAlignment": "Center"
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "Bottom"
}
],
"verticalContentAlignment": "Bottom"
}
]
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json"
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ - (UIView *)render:(UIView<ACRIContentHoldingView> *)viewGroup
trailingBlankSpace = [column addPaddingSpace];
}

if (leadingBlankSpace || trailingBlankSpace) {
column.hasStretchableView = YES;
}

if (columnElem->GetMinHeight() > 0) {
[NSLayoutConstraint constraintWithItem:column
attribute:NSLayoutAttributeHeight
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ - (UIView *)render:(UIView<ACRIContentHoldingView> *)viewGroup
}
}

// to enable filler space to fill, its superview must strech it
if (curView.hasStretchableView || (columnSetElem->GetHeight() == HeightType::Stretch)) {
[columnSetView setAlignmentForColumnStretch];
}
Expand All @@ -183,7 +184,7 @@ - (UIView *)render:(UIView<ACRIContentHoldingView> *)viewGroup
castedRenderer.fillAlignment = NO;

if ([constraints count]) {
[columnSetView addConstraints:constraints];
[NSLayoutConstraint activateConstraints:constraints];
}

std::shared_ptr<BaseActionElement> selectAction = columnSetElem->GetSelectAction();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"HostConfigHash":null,"CardHash":"a56b909","Error":null}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"HostConfigHash":null,"CardHash":"a56b909","Error":null}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "Container",
"items": [
{
"type": "TextBlock",
"text": "**Columns Vertical Alignment Test**",
"horizontalAlignment": "Center"
}
],
"style": "emphasis",
"bleed": true
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "Image",
"altText": "",
"url": "https://adaptivecards.io/content/adaptive-card-50.png",
"horizontalAlignment": "Center"
}
]
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "Top",
"horizontalAlignment": "Center",
"wrap": true
}
]
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "Center"
}
],
"verticalContentAlignment": "Center"
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "Bottom"
}
],
"verticalContentAlignment": "Bottom"
}
]
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json"
}
Loading