我正在尝试在 xcode 中制作 ScrollView 。我在 xcode 5 中使用了以下代码(有效):
View .h:
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController {
IBOutlet UIScrollView *ScrollView;
}
@end
View .m
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
[ScrollView setScrollEnabled:YES];
[ScrollView setContentSize:CGSizeMake(320, 1005)];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
我见过其他人遇到这个问题,但他们的解决方案都不适合我。请注意,我将大小设置为自由,并且自动布局已关闭。
最佳答案
试试这个 - UIScrollView with Autolayout
或者
尝试在 viewDidAppear 中设置您的内容大小
关于ios - UIScrollView 似乎在 xcode 6 (iOS 8) 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25105594/