【发布时间】:2014-02-15 04:45:10
【问题描述】:
我正在尝试创建一个 UIScrollView - 但它不起作用。我在视图中只看到一个图像 - swipe1。滚动视图确实向前滚动,但它是空白的,我没有看到其他 2 个图像。
def create_image_scroll_view_NICE
@scroll_view = UIScrollView.alloc.initWithFrame self.view.bounds
@scroll_view.delegate = self
@scroll_view.scrollsToTop = false
self.view.addSubview @scroll_view
@scroll_view.pagingEnabled = true
@scroll_view.showsHorizontalScrollIndicator = false
@scroll_view.contentSize = CGSizeMake(NUMBER_OF_PAGES * self.view.frame.size.width, self.view.frame.size.height)
@delivery_image = UIImageView.alloc.initWithImage(UIImage.imageNamed("swipe3"))
@scroll_view.addSubview @delivery_image
@notification_image = UIImageView.alloc.initWithImage(UIImage.imageNamed("swipe2"))
@scroll_view.addSubview @notification_image
@box_image = UIImageView.alloc.initWithImage(UIImage.imageNamed("swipe1"))
@scroll_view.addSubview @box_image
end
【问题讨论】: