4242/* * @var kButtonContainerBottomMargin
4343 @brief The magin between sign in buttons and the bottom of the content view.
4444 */
45- static const CGFloat kButtonContainerBottomMargin = 56 .0f ;
45+ static const CGFloat kButtonContainerBottomMargin = 48 .0f ;
4646
4747/* * @var kButtonContainerTopMargin
4848 @brief The margin between sign in buttons and the top of the content view.
4949 */
5050static const CGFloat kButtonContainerTopMargin = 16 .0f ;
5151
52+ /* * @var kTOSViewBottomMargin
53+ @brief The margin between privacy policy and TOS view and the bottom of the content view.
54+ */
55+ static const CGFloat kTOSViewBottomMargin = 24 .0f ;
56+
57+ /* * @var kTOSViewHorizontalMargin
58+ @brief The margin between privacy policy and TOS view and the left or right of the content view.
59+ */
60+ static const CGFloat kTOSViewHorizontalMargin = 16 .0f ;
61+
5262@implementation FUIAuthPickerViewController {
5363 UIView *_buttonContainerView;
5464
5565 IBOutlet FUIPrivacyAndTermsOfServiceView *_privacyPolicyAndTOSView;
5666
5767 IBOutlet UIView *_contentView;
58-
68+
5969 IBOutlet UIScrollView *_scrollView;
6070}
6171
@@ -134,18 +144,18 @@ - (void)viewDidLayoutSubviews {
134144 // old layout behavior.
135145 if (!_scrollView) {
136146 CGFloat distanceFromCenterToBottom =
137- CGRectGetHeight (_buttonContainerView.frame ) / 2 .0f + kButtonContainerBottomMargin ;
147+ CGRectGetHeight (_buttonContainerView.frame ) / 2 .0f + kButtonContainerBottomMargin + kTOSViewBottomMargin ;
138148 CGFloat centerY = CGRectGetHeight (self.view .bounds ) - distanceFromCenterToBottom;
139149 // Compensate for bounds adjustment if any.
140150 centerY += self.view .bounds .origin .y ;
141151 _buttonContainerView.center = CGPointMake (self.view .center .x , centerY);
142152 return ;
143153 }
144-
154+
145155 CGFloat buttonContainerHeight = CGRectGetHeight (_buttonContainerView.frame );
146156 CGFloat buttonContainerWidth = CGRectGetWidth (_buttonContainerView.frame );
147- CGFloat contentViewHeight = kButtonContainerTopMargin +
148- buttonContainerHeight + kButtonContainerBottomMargin ;
157+ CGFloat contentViewHeight = kButtonContainerTopMargin + buttonContainerHeight
158+ + kButtonContainerBottomMargin + kTOSViewBottomMargin ;
149159 CGFloat contentViewWidth = CGRectGetWidth (self.view .bounds );
150160 _scrollView.frame = self.view .frame ;
151161 CGFloat scrollViewHeight;
@@ -168,7 +178,10 @@ - (void)viewDidLayoutSubviews {
168178 buttonContainerWidth,
169179 buttonContainerHeight);
170180 CGFloat privacyViewHeight = CGRectGetHeight (_privacyPolicyAndTOSView.frame );
171- _privacyPolicyAndTOSView.frame = CGRectMake (0 , contentViewHeight - privacyViewHeight, contentViewWidth, privacyViewHeight);
181+ _privacyPolicyAndTOSView.frame = CGRectMake (kTOSViewHorizontalMargin , contentViewHeight
182+ - privacyViewHeight - kTOSViewBottomMargin ,
183+ contentViewWidth - kTOSViewHorizontalMargin *2 ,
184+ privacyViewHeight);
172185}
173186
174187#pragma mark - Actions
0 commit comments