9
9
#import < UIKit/UIKit.h>
10
10
11
11
@interface ScrollViewController : UIViewController <UIScrollViewDelegate>
12
+ @property (weak , nonatomic ) IBOutlet UIScrollView *longScrollview;
12
13
@property (weak , nonatomic ) IBOutlet UIScrollView *scrollView;
13
14
@end
14
15
@@ -23,6 +24,25 @@ - (void)viewDidLoad
23
24
self.scrollView .contentSize = CGSizeMake (2000 , 2000 );
24
25
self.scrollView .delegate = self;
25
26
27
+ self.longScrollview .accessibilityLabel = @" Long Scroll View" ;
28
+ CGFloat longScrollViewHeight = CGRectGetHeight (self.longScrollview .bounds ) * 2 ;
29
+ self.longScrollview .contentSize = CGSizeMake (CGRectGetWidth (self.longScrollview .bounds ), longScrollViewHeight);
30
+ self.longScrollview .backgroundColor = UIColor.redColor ;
31
+
32
+ UILabel *topLabel = [[UILabel alloc ] init ];
33
+ topLabel.text = @" THIS IS THE TOP" ;
34
+ topLabel.accessibilityLabel = @" Top Label" ;
35
+ topLabel.textAlignment = UITextAlignmentCenter;
36
+ [self .longScrollview addSubview: topLabel];
37
+ topLabel.frame = CGRectMake (0 , 0 , CGRectGetWidth (self.longScrollview .bounds ), 40 );
38
+
39
+ UILabel *bottomLabel = [[UILabel alloc ] init ];
40
+ bottomLabel.text = @" THIS IS THE BOTTOM" ;
41
+ bottomLabel.accessibilityLabel = @" Bottom Label" ;
42
+ bottomLabel.textAlignment = UITextAlignmentCenter;
43
+ [self .longScrollview addSubview: bottomLabel];
44
+ bottomLabel.frame = CGRectMake (0 , longScrollViewHeight - 40 , CGRectGetWidth (self.longScrollview .bounds ), 40 );
45
+
26
46
UIButton *bottomButton = [UIButton buttonWithType: UIButtonTypeRoundedRect];
27
47
[bottomButton setTitle: @" Down" forState: UIControlStateNormal];
28
48
bottomButton.backgroundColor = [UIColor greenColor ];
0 commit comments