0

我整天都在处理这个问题,我根本找不到到底出了什么问题。我在视图控制器中有一个滚动视图,但是当我向视图添加标签或按钮时,滚动视图停止滚动。这太标准了,我已经做了几百次了,但由于某种原因,它现在开始起作用了。希望有人可以提供帮助。

。H

@interface Test : UIViewController{

    IBOutlet UIScrollView *scrollView;


}

-(IBAction)goBack;

@end

.m

@interface Test ()

@end

@implementation Test

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    scrollView.contentSize=CGSizeMake(320.0,1100.0);

}

-(IBAction)goBack
{
    [self dismissModalViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
4

0 回答 0