UICollectionView constraints doesn't allow to scroll - objective-c

I'm expecting an issue with my UICollectionView, basicallly when I clear the constraints it scrolls perfectly though I can't reach the bottom (but that's another day's matter), however the width is way too big, I only see the left half of my UICollectionView.
Now, when I set my constraints to make it fit the screen, it won't scroll anymore. Even the UIRefreshControl isn't triggered.
I ran out of ideas, does somebody have a clue? or a solution?
Thanks a lot!
Edit:
It doesn't scroll though it bounces...

Nailed it:
Deleted my UIViewController from StoryBoard and created it again…
Looks like there's no proper solution though.

By checking the box bounce vertically , fixed my problem.

Related

weird gap when using uiscrollview and uilabel

here is the problem i have a tow muti-line label with many content, so I use a scroll view to show them all
then I follow this to do the autolayout: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/AutolayoutPG/AutoLayoutbyExample/AutoLayoutbyExample.html#//apple_ref/doc/uid/TP40010853-CH5-SW2
basic idea is to make a container view outside the scroll view to make sure the labels can fill the scroll view no matter what direction it is.
here is the hierarchy and constraint:
and the portrait mode works well:
but when it change to landscape mode some wired gap pops up!
and the more text i put in the label the higher gap i got!
my question is what should i do to kill those gap?
please give me some explicit solution or just give me an example, thank you!
and i am using autolayout in ios7, so some solution without coding are preferred!

Does NSSplitView autosavename work?

I can't seem to get NSSplitView autosave to work - can anyone confirm that by adding an autosavename in IB it should work ? I am using auto layout but my splitView is not remembering the position of the divider.
EDIT
I would expect the position of the divider to be remembered between application restarts. All I see is the divider position always starting at the default position that was set originally in IB.
Well strangely enough this now seems to be working! So I guess I can answer my own question - YES setting an autosave name in IB should result in the SplitView remembering the divider position between application launches.
No idea when it started working or why it was not working for a while. My bad no doubt.
FYI I am using a subclassed NSSplitView with autolayout. One thing I have changed is I load the right views at runtime now. Anyway for those struggling with splitViews, they can be made to work with some fiddling it seems.

UISwitch not responsive in UIScrollView

I'v encountered strange bug, and have no idea why this happens.
I have UIScrollView, in it I have 12 views. Most of them contain UISwitch button and a label. Size of views are dynamic (depending on the lenght of label.text). Everything works and shows, except two views on the bottom. They do get shown, initialize as expected. Yet UISwitches in them do not work, clicking or touching them does not do anything. Both of them are no exception to others (all of them are copy paste). I have double checked IBOutlets, they are fine. I have suspicion something is wrong with scrollView. Maybe beyond some point it doesn't recieve inputs anymore? Eventhough I can scroll up and down and everything is shown just as expected.
Any ideas what to check ?
I have switched these two views with first ones. And more bottom views get unresponsive, like there is a line, beyond which ui is not responsive. Ideas?
You say the switch is in a view (one of 12) and that view is on the scroll view,
maybe the UISwitch is out of the view bounds? Try to set that views .clipsToBounds = YES;, can you still see the switch? If no, it means the switch is out of bounds therefor you gat no touch events. Make that view larger to fix that.
Check correctly. if the UISwitch and UIscrollview user interaction are enabled.
Check whether the UISwitch is added within the UIscrollview's frame.

UIScrollView not scrolling off screen?

I have an app in which a UIScrollView of the dimensions 1056x96 on top of a screen which is 480x320 (it is in landscape.) It contains 9 UIBUttons. It definitely is able to scroll, as when I set 'bounces horizontally' to true I can clearly see it bouncing back as soon as I attempt to scroll. It simply will not scroll beyond the bounds of the screen, and I have set its contentSize to 1056x960. Does anybody have a helpful suggestion as to why this is happening? Thanks in advance!
It appears that the contentSize property must be larger than the size of the UIScrollView its self. Once I made the size of that larger, it seemed to work fine.
Also, make sure your viewForZoomingInScrollView is set to the subview rather than the scroll view itself. For example:
- (UIView*)viewForZoomingInScrollView:(UIScrollView *)scrollView{
return self.menuView;
Do you have 'userInteractionEnabled' flag set to true?. Is the scrollView embedded into another view?. If so... please, check the 'userInteractionEnabled' flag as well.
Besides that, please, check if the flag 'scrollEnabled' is enabled both in your nib and in your code.

UITextView is not scrolled well

I have a UITextView that works well, till it's content is larger than it's own frame.
In that case it's scrolled down, but for some reason I cant re-scroll it back to the beginning, but only a few lines up.
How do I control the size of the content and the range of scrolling?
thanks
stupid problem, but I'll answer anyway:
I had a scrollViewDidScroll method in order to control a UITableView scrolling.
This method was called also when my textView was scrolled - and actually made some troubles.
so I just checked the sender in the first line:
if (sender==textView) return;
thanks for the help..