-2

I updated xcode to 4.5 but now when I make à UIScrollview it stops scrolling as soon I place something in the scroll like à label or button, when I remove them the scrolls works again

someone knows the fix?

Code

My ScrollView is 320 by 430 and in my viewdidload I use:

    [scroller setScrollEnabled:YES];
    [scroller setContentSize:CGSizeMake(320, 481)];

edit

I just discovered that in landscape mode it does scroll so maybe I am setting my content size wrong? :S

edit#2

It works now if I make a text view in the scrollview and make the text larger then the screen, but When I place a button into it the button doesnt scroll along ..

Extra I made a video showing What I do hope someone can tell me what im doing wrong http://www.youtube.com/watch?v=rzYTWLiIC8g&feature=youtu.be

Kevin
  • 291
  • 4
  • 15
  • what is the content size of the scrollview? – AppleDelegate Sep 25 '12 at 10:51
  • you need to show your source code then it will be easy to trace the problem. – Pandey_Laxman Sep 25 '12 at 10:51
  • I think, you just have to set contentsize of your scrollViewlike this: [scrollView setContentSize:CGSizeMake(1000, 1000)]; – Rafael Kayumov Sep 25 '12 at 10:54
  • I know one size has to be bigger for it to work and it does but when I put something in je view it stops working realy strange .. and in my previous xcode it works perfectly .. – Kevin Sep 25 '12 at 11:07
  • It works perfect it works just like it should but as soon as I place ANYTHING in the view it doesn't scroll :S:S – Kevin Sep 25 '12 at 12:36
  • When I build in landscape mode it works but if I put something in then then the horizontal scroller stops working its really strange :S:S – Kevin Sep 25 '12 at 12:37
  • Lol getting -2 while this is a serious problem – Kevin Sep 26 '12 at 12:45
  • check this out if it helps `http://stackoverflow.com/questions/10801794/uiscrollview-cannot-see-scrollbars-indicators/10802219#10802219` – Singh Sep 25 '12 at 11:50

3 Answers3

0

You don't have enough content for scrolling.

Please add more content text. Then only it scroll.

Pang
  • 9,564
  • 146
  • 81
  • 122
Vineesh TP
  • 7,755
  • 12
  • 66
  • 130
  • But it does scroll it just stops scrolling when I put something in it like a label or button .. and in my previous xcode it scrolls aswell I also tried to change the content size to see if it starts scrolling but as soon as I place something in it, it stops scrolling – Kevin Sep 25 '12 at 11:20
  • 1. which device You are using? 2. Can you specify the scrollView frame 3. What is the contett size of the scrollView? – Vineesh TP Sep 25 '12 at 11:24
  • Im using my iOS 6 simulator and test on iPhone 4s running iOS 6, I edited my question with some code – Kevin Sep 25 '12 at 11:34
  • How much text you are entered?. Please enter more text and again test. Can you show the frame of the scrollView ? – Vineesh TP Sep 25 '12 at 11:51
  • Its only the horizontal scroll that still works when I put something it, so When I put something in the vertical scroll stops working I try everything I really don't know anymore:S – Kevin Sep 25 '12 at 12:28
  • I said Can you specify the frame of the scrollView ? – Vineesh TP Sep 25 '12 at 17:54
  • I made a video showing what Im doing and showing that it doesn't scroll as soon as I place something in it, maybe im doing something wrong hope you can tell me what I do wrong, http://www.youtube.com/watch?v=rzYTWLiIC8g&feature=youtu.be – Kevin Sep 25 '12 at 19:48
  • I just said can you show me your scrollView frame. check that in our Conversation how many times I asked you for your scrollView frame. If you coulnd'tget my question be frankly ask me, Other wise sorry. – Vineesh TP Sep 26 '12 at 07:35
  • 360x430 Check the video my problem is so clearly showed there – Kevin Sep 26 '12 at 07:44
  • I think You couldn't undestand my question. I need the frame of your scrollView. ie, scrollViewname.frame=CGRectMake(); Which values you are given to this ? – Vineesh TP Sep 26 '12 at 09:25
  • Im not sure what you mean I got my UIScrollView 320x430, the scroller setContentSize:GCSizeMake(320x481) .. but I have not used CGRectMake(); – Kevin Sep 26 '12 at 10:42
  • K, Can you tell the height and width positions of your scrollView – Vineesh TP Sep 27 '12 at 06:22
0

"Use Autolayout" was on it has to be off and it will be fixed thanks for all your support.

Kevin
  • 291
  • 4
  • 15
-1

Set the contentSize of your scroll view to the size of the content, eg. if you have 10 rows of buttons, each row's height let's say 40px, and padding 5px, the height (height if you are putting the content vertically, width if horizontally) of the contentSize of the scroll view is: 10*45.0f+5.0f. If this doesn't help, then show us your code.

Fahri Azimov
  • 11,470
  • 2
  • 21
  • 29