@@ -26,6 +26,11 @@ import UIKit
26
26
27
27
/// The title of the page.
28
28
@objc public let title : String
29
+
30
+ /// The alignments of the title and description
31
+ public var titleAlignment : NSTextAlignment = . center
32
+ public var descriptionAlignment : NSTextAlignment = . center
33
+ public var imageContentMode : UIView . ContentMode = . scaleAspectFit
29
34
30
35
/**
31
36
* An image to display below the title.
@@ -179,7 +184,7 @@ import UIKit
179
184
180
185
// Title
181
186
let isNextToCloseButton = isDismissable && requiresCloseButton
182
- let titleView = interfaceBuilder. makeTitleLabel ( isNextToCloseButton: isNextToCloseButton)
187
+ let titleView = interfaceBuilder. makeTitleLabel ( isNextToCloseButton: isNextToCloseButton, titleAlginment : titleAlignment )
183
188
titleView. label. text = title
184
189
185
190
self . titleLabel = titleView
@@ -189,7 +194,8 @@ import UIKit
189
194
// Image View
190
195
if let image = self . image {
191
196
let imageView = UIImageView ( image: image)
192
- imageView. contentMode = . scaleAspectFit
197
+ imageView. contentMode = imageContentMode
198
+ // imageView.contentMode = .scaleAspectFit
193
199
imageView. tintColor = appearance. imageViewTintColor
194
200
195
201
if let accessibilityLabel = imageAccessibilityLabel {
@@ -206,13 +212,13 @@ import UIKit
206
212
207
213
// Description Label
208
214
if let attributedDescription = attributedDescriptionText {
209
- let label = interfaceBuilder. makeDescriptionLabel ( )
215
+ let label = interfaceBuilder. makeDescriptionLabel ( descriptionAlginment : descriptionAlignment )
210
216
label. attributedText = attributedDescription
211
217
contentViews. append ( label)
212
218
self . descriptionLabel = label
213
219
insertComplementaryViews ( makeViewsUnderDescription)
214
220
} else if let description = descriptionText {
215
- let label = interfaceBuilder. makeDescriptionLabel ( )
221
+ let label = interfaceBuilder. makeDescriptionLabel ( descriptionAlginment : descriptionAlignment )
216
222
label. text = description
217
223
contentViews. append ( label)
218
224
self . descriptionLabel = label
0 commit comments