【发布时间】:2013-01-25 19:35:38
【问题描述】:
当我使用 UIScrollView 向下滚动并放手时,它不会停留在我向下滚动的位置,它会弹回顶部
http://www.joules.name/ScreenShot2013-01-25at19.11.45.png
http://joules.name/ScreenShot2013-01-25at19.04.12.png
在 ViewController.h 中
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
{
IBOutlet UIScrollView *scoller;
}
@end
在 ViewController.m 中
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidAppear
{
[scoller setScrollEnabled:YES];
[scoller setContentSize:CGSizeMake(320, 1000)];
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
【问题讨论】:
-
有趣。我在 Xcode 4.5.2 中看不到内容拥抱和压缩属性。
-
笔尖的scrollview高度怎么是800..你在iPad上吗?
标签: ios uiscrollview xcode4.5