iPhone SDK:按钮和标签导致UIScrollView无法滚动

时间:2013-05-19 21:29:58

标签: uiscrollview uibutton uilabel

我一整天都在处理这件事,我根本无法找到问题所在。我在viewcontroller中有一个scrollview,但是当我向视图添加标签或按钮时,滚动视图停止滚动。这是如此标准我已经完成了数百次,但由于某种原因它现在起作用了。希望有人可以提供帮助。

·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

0 个答案:

没有答案