BVB Source Codes

AsyncDisplayKit Show ASCenterLayoutSpec.h Source code

Return Download AsyncDisplayKit: download ASCenterLayoutSpec.h Source code - Download AsyncDisplayKit Source code - Type:.h
  1. //
  2. //  ASCenterLayoutSpec.h
  3. //  AsyncDisplayKit
  4. //
  5. //  Copyright (c) 2014-present, Facebook, Inc.  All rights reserved.
  6. //  This source code is licensed under the BSD-style license found in the
  7. //  LICENSE file in the root directory of this source tree. An additional grant
  8. //  of patent rights can be found in the PATENTS file in the same directory.
  9. //
  10.  
  11. #import <AsyncDisplayKit/ASRelativeLayoutSpec.h>
  12.  
  13. /**
  14.   * How the child is centered within the spec.
  15.   *
  16.   * The default option will position the child at {0,0} relatively to the layout bound.
  17.   * Swift: use [] for the default behavior.
  18.   */
  19. typedef NS_OPTIONS(NSUInteger, ASCenterLayoutSpecCenteringOptions) {
  20.   /** The child is positioned in {0,0} relatively to the layout bounds */
  21.   ASCenterLayoutSpecCenteringNone = 0,
  22.   /** The child is centered along the X axis */
  23.   ASCenterLayoutSpecCenteringX = 1 << 0,
  24.   /** The child is centered along the Y axis */
  25.   ASCenterLayoutSpecCenteringY = 1 << 1,
  26.   /** Convenience option to center both along the X and Y axis */
  27.   ASCenterLayoutSpecCenteringXY = ASCenterLayoutSpecCenteringX | ASCenterLayoutSpecCenteringY
  28. };
  29.  
  30. /**
  31.   * How much space the spec will take up.
  32.   *
  33.   * The default option will allow the spec to take up the maximum size possible.
  34.   * Swift: use [] for the default behavior.
  35.   */
  36. typedef NS_OPTIONS(NSUInteger, ASCenterLayoutSpecSizingOptions) {
  37.   /** The spec will take up the maximum size possible */
  38.   ASCenterLayoutSpecSizingOptionDefault = ASRelativeLayoutSpecSizingOptionDefault,
  39.   /** The spec will take up the minimum size possible along the X axis */
  40.   ASCenterLayoutSpecSizingOptionMinimumX = ASRelativeLayoutSpecSizingOptionMinimumWidth,
  41.   /** The spec will take up the minimum size possible along the Y axis */
  42.   ASCenterLayoutSpecSizingOptionMinimumY = ASRelativeLayoutSpecSizingOptionMinimumHeight,
  43.   /** Convenience option to take up the minimum size along both the X and Y axis */
  44.   ASCenterLayoutSpecSizingOptionMinimumXY = ASRelativeLayoutSpecSizingOptionMinimumSize
  45. };
  46.  
  47. NS_ASSUME_NONNULL_BEGIN
  48.  
  49. /** Lays out a single layoutElement child and position it so that it is centered into the layout bounds.
  50.   * NOTE: ASRelativeLayoutSpec offers all of the capabilities of Center, and more.
  51.   * Check it out if you would like to be able to position the child at any corner or the middle of an edge.
  52.  */
  53. @interface ASCenterLayoutSpec : ASRelativeLayoutSpec
  54.  
  55. @property (nonatomic, assign) ASCenterLayoutSpecCenteringOptions centeringOptions;
  56. @property (nonatomic, assign) ASCenterLayoutSpecSizingOptions sizingOptions;
  57.  
  58. /**
  59.  * Initializer.
  60.  *
  61.  * @param centeringOptions How the child is centered.
  62.  * @param sizingOptions How much space will be taken up.
  63.  * @param child The child to center.
  64.  */
  65. + (instancetype)centerLayoutSpecWithCenteringOptions:(ASCenterLayoutSpecCenteringOptions)centeringOptions
  66.                                        sizingOptions:(ASCenterLayoutSpecSizingOptions)sizingOptions
  67.                                                child:(id<ASLayoutElement>)child AS_WARN_UNUSED_RESULT;
  68.  
  69. @end
  70.  
  71. NS_ASSUME_NONNULL_END
  72.  
downloadASCenterLayoutSpec.h Source code - Download AsyncDisplayKit Source code
Related Source Codes/Software:
lottie-android - Render After Effects animations natively on Androi... 2017-06-07
parse-server - Parse-compatible API server module for Node/Expres... 2017-06-07
react-boilerplate - 2017-06-07
webtorrent - Streaming torrent client for the web ... 2017-06-06
ionicons - The premium icon font for Ionic ... 2017-06-07
storybook - 2017-06-07
prettier - Prettier is an opinionated JavaScript formatter. ... 2017-06-08
inferno - An extremely fast, React-like JavaScript library f... 2017-06-08
guetzli - Perceptual JPEG encoder 2017-06-08
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top