开发者

Why won't my UIScrollView Scroll when I use a window based template instead of a view based template?

So I have 2 projects, I created one using a the window based application template and one using the view based application template. I created a UIScrollView in both. The view based one works and the window based one doesn't. Does anyone know why? Please help.

Here is my relevant initialization code:

@interface Scroller : UIViewController<UIScrollViewDelegate> {

}

- (void)viewDidLoad {
[super viewDidLoad];
[(UIScrollView*)self.view setScrollEnabled:YES];
[(UIScrollView*)self.view setContentSize:CGSizeMake(320, 800)];

}

In interface builder I set scroller's view to the UIScrollview, and the UIscrollView's delegate to Scroller. I also set the size of UIScrollView 开发者_JS百科to (320, 800).

Here is where I create the view controller.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    

// Override point for customization after application launch.

Scroller *scroller = [[Scroller alloc] initWithNibName:@"Scroller" bundle:[NSBundle mainBundle]];
[window addSubview:scroller.view]; 
[scroller release]; 

[window makeKeyAndVisible];

return YES;

}

Is there something I am missing. Please help.

Thx,

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜