iOS UIScrollView反弹回顶部

时间:2013-01-25 19:35:39

标签: ios uiscrollview xcode4.5

当我向下滚动使用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

1 个答案:

答案 0 :(得分:0)

可能是因为你在nib文件中将scrollview的实际高度设置为800。改变它以适应屏幕。