2013-06-05 182 views
0

我有一个测试应用程序,我试图让UIView滚动,并且当键盘出现在屏幕上时也向上移动。当我将下面的代码放入并尝试在模拟器中运行滚动时,我的UIScroll不起作用。UIScrollView不滚动滚动RubyMotion

@scrollwindow = UIScrollView.alloc.initWithFrame(CGRect.new([0,0],[700,800])) 
@scrollwindow.scrollEnabled = true 
@scrollwindow.delegate 
@window.addSubview(@scrollwindow) 

@frame1 = UIView.alloc.initWithFrame(CGRect.new([10,10], [400, 200])) 
@frame1.backgroundColor = UIColor.redColor 
@scrollwindow.addSubview(@frame1) 

@frame2 = UIView.alloc.initWithFrame(CGRect.new([20, 400], [600,700])) 
@frame2.backgroundColor = UIColor.greenColor 
@scrollwindow.addSubview(@frame2) 

我熟悉我对Ruby的理解,但对RubyMotion和Objective-C社区是新的。任何帮助将不胜感激。

+0

http://stackoverflow.com/questions/5522148/why-wont-basic-uiscrollview-with-a-few-buttons-scroll – silasjmatson

回答