-
Notifications
You must be signed in to change notification settings - Fork 44
Auk configuration
Evgenii Neumerzhitckii edited this page Jun 17, 2016
·
7 revisions
The Great Auks at Home, oil on canvas by John Gerrard Keulemans. Source: Wikimedia Commons.
One can configure the scroll view by using its auk.settings
property before showing the images.
// Make the images fill entire page
scrollView.auk.settings.contentMode = .scaleAspectFill
List of available scroll view styles:
-
contentMode: Determines the stretching and scaling of the image when its proportion are not the same as its container. Default:
.scaleAspectFit
. - errorImage: Image to be displayed when remote image download fails.
-
pagingEnabled: Enable paging for the scroll view. When true the view automatically scrolls to show the whole image. Default:
true
. - placeholderImage: Image to be displayed while the remote image is being downloaded.
-
preloadRemoteImagesAround: The number of remote images to preload around the current page. For example, if
preloadRemoteImagesAround = 2
and we are viewing the first page it will preload images on the second and third pages. If we are viewing 5th page then it will preload images on pages 3, 4, 6 and 7 (unless they are already loaded). The default value is0
, i.e. it only loads the image for the currently visible pages. -
remoteImageAnimationIntervalSeconds: Duration of the animation that is used to show remote images. Default:
0.5
. -
showsHorizontalScrollIndicator: Determines if horizontal scrolling indicator is visible. Default:
false
.
Use settings.pageControl
to configure the page control element before showing the images.
scrollView.auk.settings.pageControl.cornerRadius = 5
List of available page control styles:
-
backgroundColor: Background color of the page control container view. Default:
#808080
at 40% alpha. -
cornerRadius: Corner radius of page control container view. Default:
13
. -
currentPageIndicatorTintColor: Color of the current page dot. Default:
nil
. -
innerPadding: Padding between page indicator and its container. Default:
CGSize(width: 10, height: -5)
. -
marginToScrollViewBottom: Distance between the bottom of the page control view and the bottom of the scroll view. Default:
8
. -
pageIndicatorTintColor: Color of the page indicator dot. Default:
nil
. -
visible: When true the page control is visible on screen. Default:
true
.