我阅读了所有其他类似问题的回复,但我的项目仍然无法正常工作。有什么帮助吗?
这是我的项目。
----------------> viewController.h
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController{
IBOutlet UIScrollView *scroll;
IBOutlet UIImageView *imagev;
}
----------------> viewController.m
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
imagev.image = [UIImage imageNamed:@"ka.jpg"];
[scroll setContentSize:CGSizeMake(700, 700)];
[scroll setScrollEnabled:TRUE];
[scroll setShowsVerticalScrollIndicator:YES];
[scroll setShowsHorizontalScrollIndicator:YES];
}
@end
一切看起来都很好,但滚动视图不会滚动..
编辑:正如他们在这里建议的那样,问题是自动布局。我修复了滚动视图