Edit in GitHubLog an issue

AEPStack

The AEPStack class is a fundamental layout container used to arrange multiple UI elements horizontally or vertically.

AEPStack conforms to ObservableObject, allowing it to be used reactively in SwiftUI views.

Public Properties

PropertyTypeDescriptionDefault Value
spacing
CGFloat
The spacing between child views in the stack.
8
modifier
AEPViewModifier
A custom view modifier for additional styling.
N/A

AEPHStack

The AEPHStack class extends AEPStack and arranges its child views horizontally. It provides additional customization for aligning child views vertically.

Public Properties

PropertyTypeDescriptionDefault Value
alignment
The vertical alignment of child views in the stack.

AEPVStack

The AEPVStack class extends AEPStack and arranges its child views vertically. It provides additional customization for aligning child views horizontally.

Public Properties

PropertyTypeDescriptionDefault Value
alignment
The horizontal alignment of child views in the stack.

Customization

Below is an example of how to customize the AEPHStack and AEPVStack properties when working with a SmallImageTemplate:

Copied to your clipboard
class MyCustomizer : ContentCardCustomizing {
func customize(template: SmallImageTemplate) {
// customize stack properties
template.rootHStack.spacing = 10
template.textVStack.alignment = .leading
template.textVStack.spacing = 20
// Customize the button stack
template.buttonHStack.modifier = AEPViewModifier(ButtonHStackModifier())
}
struct ButtonStackModifier: ViewModifier {
func body(content: Content) -> some View {
content
.frame(maxWidth: .infinity, alignment: .trailing)
}
}
}
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.