Я хотел бы отобразить 5 кнопок в окне ScrollView, но, к сожалению, код, который я написал, не влияет на мои кнопки UIB (я не могу прокрутить вверх или вниз, вы можете сказать мне, почему?
Спасибо за вашу помощь, я потратил на это много часов (новичок), но все еще не могу найти решение ...
Мой код:
FirstViewController.h:
#import <UIKit/UIKit.h>
@interface FirstViewController : UIViewController <UIScrollViewDelegate> {
IBOutlet UIScrollView *scroll;
UIButton *button;
UIButton *button2;
UIButton *button3;
}
@property (nonatomic, retain) IBOutlet UIButton *button;
@property (nonatomic, retain) IBOutlet UIButton *button2;
@property (nonatomic, retain) IBOutlet UIButton *button3;
@property(nonatomic,retain) IBOutlet UIScrollView *scroll;
@end
FirstViewController.m:
#import "FirstViewController.h"
@implementation FirstViewController
@synthesize button;
@synthesize button2;
@synthesize button3;
@synthesize scroll;
- (IBAction)goToViewTwo {
}
- (void)viewDidload {
[super viewDidLoad];
[scroll setScrollEnabled:YES];
[scroll setContentSize:CGSizeMake (500, 1000)];
}
- (void)dealloc {
[super dealloc];
[button release];
[scroll release];
}
@end
Иерархия в FirstView.xib:
View
Action Sheet
Text View
ScrollView
Button
Button
Button
Об аутлетах:
- Scrollview связан с владельцем файла с помощью «Scroll»
- Вид связан с владельцем файла как «вид»