Class: UIScrollGallery
- Inherits:
-
UIScrollView
- Object
- UIScrollView
- UIScrollGallery
- Defined in:
- lib/project/views/ui_scroll_gallery.rb
Instance Method Summary collapse
Instance Method Details
#add_images(images) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/project/views/ui_scroll_gallery.rb', line 16 def add_images(images) images.each_with_index do |i, x| image = UIImageView.alloc.initWithFrame([[UIScreen.mainScreen.bounds.size.width * x, 0], [UIScreen.mainScreen.bounds.size.width, 290]]) image.image = UIImage.imageNamed(i) self.addSubview(image) end end |
#initWithNumImages(num_images, frame: frame) ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/project/views/ui_scroll_gallery.rb', line 2 def initWithNumImages(num_images,frame: frame) scrollView = UIScrollGallery.alloc.init scrollView.frame = frame scrollView.pagingEnabled = true; scrollView.contentSize = CGSizeMake(scrollView.frame.size.width * num_images, scrollView.frame.size.height); scrollView.showsHorizontalScrollIndicator = true scrollView.showsVerticalScrollIndicator = false scrollView.maximumZoomScale = 1.0 scrollView.minimumZoomScale = 1.0 scrollView.clipsToBounds = true scrollView.scrollsToTop = false scrollView end |