UITextView is not scrolled well - objective-c

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..

Related

UICollectionView constraints doesn't allow to scroll

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.

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.

Strange behaviour of vertical uiscrollbar at uitableview

I am using the code below to set the content offset of the uitableview after the retrieval of more data from a server.
[tablefollow setContentOffset:CGPointMake(0, tablefollow.contentSize.height- self.tablefollow.bounds.size.height-5+ (numLines*(25/numLines))) animated:NO];
For some reason when i scroll down fast with my finger i notice that the vertical scroll bar reaches the end and disappears but then reappears a few rows up just for a second and then disappears again! This is happening when i am scrolling with my finger fast to the bottom of the uitableview. This does not occur when i slowly scroll to the bottom of the uitableview. Anyone got this issue before?
Any help appreciated.
The issue was that the code i mentioned was called even when the user was scrolling the uitableview. It has nothing to do with the speed of the scroll. I just added a value in the scrollviewdidbegindragging and set it to TRUE and then when the scrollviewdidenddragging occurs i set it to FALSE. I have put this code in to my function
If (!scrollingvalue)
{
//execute code
}
When the value is FALSE (which means that the uitableview is not dragged by the user) then the code is executed else it is not executed. Hope it helps someone.

NSScrollView scroll downward when resizing?

I have a NSScrollView with a custom view inside and when I resize the NSScrollView, the height grows and it scrolls upward. Unless there is an easier way, I'll probably have to register a notification to see if the view changes size and then adjust the scrollPoint: to a new point. I'm having trouble getting method to work smoothly.
Thanks!
This question comes up from time to time, because it's not obvious.
The content will pin to the top left if [contentView isFlipped] == YES.