No Description

SGPageTitleViewConfigure.m 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. //
  2. // SGPageTitleViewConfigure.m
  3. // SGPagingViewExample
  4. //
  5. // Created by kingsic on 2017/10/16.
  6. // Copyright © 2017年 kingsic. All rights reserved.
  7. //
  8. #import "SGPageTitleViewConfigure.h"
  9. @implementation SGPageTitleViewConfigure
  10. - (instancetype)init {
  11. if (self = [super init]) {
  12. [self initialization];
  13. }
  14. return self;
  15. }
  16. - (void)initialization {
  17. _needBounces = YES;
  18. _showBottomSeparator = YES;
  19. _showIndicator = YES;
  20. }
  21. + (instancetype)pageTitleViewConfigure {
  22. return [[self alloc] init];
  23. }
  24. #pragma mark - - SGPageTitleView 属性
  25. - (UIColor *)bottomSeparatorColor {
  26. if (!_bottomSeparatorColor) {
  27. _bottomSeparatorColor = [UIColor lightGrayColor];
  28. }
  29. return _bottomSeparatorColor;
  30. }
  31. #pragma mark - - 标题属性
  32. - (UIFont *)titleFont {
  33. if (!_titleFont) {
  34. _titleFont = [UIFont systemFontOfSize:15];
  35. }
  36. return _titleFont;
  37. }
  38. - (UIFont *)titleSelectedFont {
  39. if (!_titleSelectedFont) {
  40. _titleSelectedFont = [UIFont systemFontOfSize:15];
  41. }
  42. return _titleSelectedFont;
  43. }
  44. - (UIColor *)titleColor {
  45. if (!_titleColor) {
  46. _titleColor = [UIColor blackColor];
  47. }
  48. return _titleColor;
  49. }
  50. - (UIColor *)titleSelectedColor {
  51. if (!_titleSelectedColor) {
  52. _titleSelectedColor = [UIColor redColor];
  53. }
  54. return _titleSelectedColor;
  55. }
  56. - (CGFloat)titleTextZoomRatio {
  57. if (_titleTextZoomRatio <= 0.0) {
  58. _titleTextZoomRatio = 0.0;
  59. } else if (_titleTextZoomRatio >= 1.0){
  60. _titleTextZoomRatio = 1.0;
  61. }
  62. return _titleTextZoomRatio * 0.5;
  63. }
  64. - (CGFloat)titleAdditionalWidth {
  65. if (_titleAdditionalWidth <= 0) {
  66. _titleAdditionalWidth = 20;
  67. }
  68. return _titleAdditionalWidth;
  69. }
  70. #pragma mark - - 指示器属性
  71. - (UIColor *)indicatorColor {
  72. if (!_indicatorColor) {
  73. _indicatorColor = [UIColor redColor];
  74. }
  75. return _indicatorColor;
  76. }
  77. - (CGFloat)indicatorHeight {
  78. if (_indicatorHeight <= 0) {
  79. _indicatorHeight = 2.0f;
  80. }
  81. return _indicatorHeight;
  82. }
  83. - (CGFloat)indicatorAnimationTime {
  84. if (_indicatorAnimationTime <= 0) {
  85. _indicatorAnimationTime = 0.1;
  86. } else if (_indicatorAnimationTime > 0.3) {
  87. _indicatorAnimationTime = 0.3;
  88. }
  89. return _indicatorAnimationTime;
  90. }
  91. - (CGFloat)indicatorCornerRadius {
  92. if (_indicatorCornerRadius <= 0) {
  93. _indicatorCornerRadius = 0;
  94. }
  95. return _indicatorCornerRadius;
  96. }
  97. - (CGFloat)indicatorToBottomDistance {
  98. if (_indicatorToBottomDistance <= 0) {
  99. _indicatorToBottomDistance = 0;
  100. }
  101. return _indicatorToBottomDistance;
  102. }
  103. - (CGFloat)indicatorBorderWidth {
  104. if (_indicatorBorderWidth <= 0) {
  105. _indicatorBorderWidth = 0;
  106. }
  107. return _indicatorBorderWidth;
  108. }
  109. - (UIColor *)indicatorBorderColor {
  110. if (!_indicatorBorderColor) {
  111. _indicatorBorderColor = [UIColor clearColor];
  112. }
  113. return _indicatorBorderColor;
  114. }
  115. - (CGFloat)indicatorAdditionalWidth {
  116. if (_indicatorAdditionalWidth <= 0) {
  117. _indicatorAdditionalWidth = 0;
  118. }
  119. return _indicatorAdditionalWidth;
  120. }
  121. - (CGFloat)indicatorFixedWidth {
  122. if (_indicatorFixedWidth <= 0) {
  123. _indicatorFixedWidth = 20;
  124. }
  125. return _indicatorFixedWidth;
  126. }
  127. - (CGFloat)indicatorDynamicWidth {
  128. if (_indicatorDynamicWidth <= 0) {
  129. _indicatorDynamicWidth = 20;
  130. }
  131. return _indicatorDynamicWidth;
  132. }
  133. #pragma mark - - 标题间分割线属性
  134. - (UIColor *)verticalSeparatorColor {
  135. if (!_verticalSeparatorColor) {
  136. _verticalSeparatorColor = [UIColor redColor];
  137. }
  138. return _verticalSeparatorColor;
  139. }
  140. - (CGFloat)verticalSeparatorReduceHeight {
  141. if (_verticalSeparatorReduceHeight <= 0) {
  142. _verticalSeparatorReduceHeight = 0;
  143. }
  144. return _verticalSeparatorReduceHeight;
  145. }
  146. #pragma mark - - badge 相关属性
  147. - (UIColor *)badgeColor {
  148. if (!_badgeColor) {
  149. _badgeColor = [UIColor redColor];
  150. }
  151. return _badgeColor;
  152. }
  153. - (CGFloat)badgeSize {
  154. if (!_badgeSize) {
  155. _badgeSize = 7.0f;
  156. }
  157. return _badgeSize;
  158. }
  159. - (CGPoint)badgeOff {
  160. if (!_badgeOff.x && !_badgeOff.y) {
  161. _badgeOff = CGPointMake(0, 0);
  162. }
  163. return _badgeOff;
  164. }
  165. @end