UIScrollView with multiple UIImageView shown - ios

I'm trying to achieve scroll view with multiple images. I put the UIScrollView and put 3 UIImageView which the last one is out of bounds. I though that i can scroll the content of the srollview component. How could i achieve this. I have just found examples where the scrollView show just one picture at the time. How could i have multiple pictures shown in UIScrollView.
Something like this:
Thanks

OK the correct method which i was looking for is setContentSize. I thought that there is some setting to do this automatically to the included content. But as Grett writhed there is nothing like that. So i guest this is the only way do that.

Related

Stretchy header view for UICollectionview and minimize UIImageView while scrolling up

I am trying to achieve a certain layout that looks like twitter and many other apps. Some people do it in UIVIewLayouts but I want to achieve it using this way (if possible ). As you see in the attached image. I have Header, and cells in the collectionview.
While scrolling up I want to minimize the imagview avatar inside the headerview. -> ( ViewForSupplementaryEelementHeader )
while scrolling down, I want to make the top UIImageview to be fixed to the top and stretchy
Thank you all in advance
*ps I am doing all of this in code nothing with storyboard and I dont want to use it at all.
Please advise me how to access these imageview while scrolling up and down.
I think this is the example you are looking for
https://github.com/sunlubo/StretchyHeaderView
This will add only tableview in storyboard...other all the work is done through coding

How create a tableView that covers an image when it is scrolled

I'm trying to develop something like CSStickyHeaderFlowLayout but customized for my table, but I'm not sure how can I achieve this goal. The idea is
Someone can give me a hint how achieve this objective?
To add to Vollan's answer, to make the title stay still you could use a view that contains two subviews: the first is the scrollview (with the image and table as Vollan suggests) and then add another view (like a UILabel) for the title. Thus, while the image and table scroll in the scrollview, the title will stay still.
Best solution would be to wrap everything inside an UIScrollView. That will allow you to scroll to bottom of the screen and then only scroll the tableview. That way it will appear like the tableview will overlay the image.
While using a tableview within a scrollview would likely work, your tableview would have to always be it's full size (without some annoying constant re-sizing), so you'll lose the value of the enqueuing/dequeueing that makes tableViews work so well.
The CSStickyHeaderFlowLayout has example pretty similar to what you want to do, did you look at their examples? You may be able to play with it and get it to do what you want If your problem is simply having a constant title, you can just add a view above the table or use the NavBar and adjust the contentInsets
You might also consider using a collectionView instead. It's much more flexible as far as layout goes.

Snapshot of complete UIScrollView

i'm trying to create a snapshot of a complete uiscrollview, all the content size, i have searched a lot, and i have found something here on SO, like this:
Getting a screenshot of a UIScrollView, including offscreen parts
i have tried it, but there is a problem, because in the screenshot some element for example some UIImageView are enlarged or stretch, or in a different position, i can't understand why, anyone can help me to create this snapshot?
I'm not sure, but I think that UIScrollView elements are created and updated when they appear to the user. If so, probably their frames are not ready to be displayed when not on the shown "window".
Try to rasterize the content of your UIScrollView.
yourLayer.shouldRasterize = YES;
This way eveything should be updated at one time.

How Do I Create A Simple Scroll View That Scrolls Through Static Images?

Perhaps it's something with Xcode 4.5+ or iOS 6 that makes my research fruitless so far, but...
Apple's own advice hasn't worked for me. I set the contentSize to something different, and it causes no changes.
I found this wasn't unique to me, but the answer in that question 1.) does not inform me about the problem and 2.) I'm left wondering if it's really impossible to create a simple, non-inheriting example of UIScrollView. Thus, this question.
A better answer's code was tried within viewDidLoad and viewDidAppear, but to no avail.
So what gives? Is it possible to create a simple, image-filled view that allows scrolling? Say... something as easy as this basic project I set up on github -- but working?
Create and initialize a UIScrollView
Add it as subview to the view of viewcontroller
Make an array of image names
In a loop create UIImageView and add the images and add imageviews into scrollview considering the width of images, set the frame of imageviews
Number of images is known and the width it consumes can be calulated from the loop itself use it to set the contentSize of the scrollview

slideshow of a collection of images managed with uicollectionview

I'm using a UICollectionView (with horizontal layout) to manage a collection of images. The view controller that manages the collection view has the bottom toolbar visible with a play button to start a slideshow of the images in the collection. My question is what is the best way to implement a slideshow that involves a collection view? My initial thought was to try to make the collection view changing the visible cells with a UIView transition (transitionFromView or transitionWithView) with a cross dissolve option but I didn't get the effect I was expecting (maybe something wrong in my code). The other idea I had was to simply add a subview to the collection view to handle slideshow. This subview would have access to the data source and be able to iterate through the images. Don't know if this last option is a good way to approach the problem. Anyone has ever tried this and/or what would the recommendation be to solve this problem?
My idea is no need of collection view. In scrollview place imageview which display images. In timer Change the offset of scrollview. so it looks like automatically images are changing as like slide show.

Resources