Scroll view with an image is not scrolling

i added an image to the scroll view. but its not scrolling... pls help out what is the problem..


boxImage = [[UIImageView alloc]initWithFrame:CGRectMake(0, 44, 320, 372)]; boxImage.image = [UIImage imageNamed:@"chapter1box.png"]; textScroll = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 175, 320, 755)]; scrollTextImg = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 320, 775)]; scrollTextImg.image = [UIImage imageNamed:@"chapter1narrationtext.png"]; textScroll.backgroundColor = [UIColor clearColor]; textScroll.scrollEnabled = YES; textScroll.pagingEnabled = YES; textScroll.directionalLockEnabled = YES; textScroll.autoresizesSubviews = YES; textScroll.contentSize = CGSizeMake(320, 775); [self.view addSubview:boxImage]; [boxImage addSubview:textScroll]; [textScroll addSubview:scrollTextImg];


UIImageView has userInteractionEnabled property set to NO by default. Adding

boxImage.userInteractionEnabled = YES;

should help.

The scroll view size has to be smaller than the size of it's content for scrolling to work.

in the code i add the scrollview to an image view i added it to the self.view its working now.

cant we add a scroll view to an imageview..?

Category:iphone Time:2010-11-02 Views:0

Related post

  • How do I prevent a scroll view from letting a user (temporarily) scroll a UIScrollView out of it's content area? 2012-03-12

    UIScroll view lets me declared a scrollable area when I have too much content for one page. Strangely, the scroll view in question behaves as desired in the X-axis, with no scrolling whatsoever allowed. Unfortunately, the Y axis -- where scrolling is

  • Touchable info (i) button on top of Scroll View 2010-07-20

    Is there better (framework built in) way to add small "touchable" round info button (i) on top of scroll view? Theoretically I think there should be container view for button(UIControl or UIImageView with png?) and scroll view. --------------Solution

  • android-How to put scroll view under scroll view 2011-06-09

    My application need to 2 scroll views(sv1,sv2). sv1 is main scroll view and sv2 is sub scroll view of sv1. is it possible? then how to do it. Following one is my answer. it is working in simulator only but not working in device means device support s

  • How to make scroll view reposition back to the top when I click a button 2011-07-19

    Hi I have a image in a view controller that has a scroll view, when the user scrolls to the bottom, there is a button that they click and it hides the view they were looking at and loads another, but it stays at the bottom because of the scroll view,

  • can we make horizontal scroll view infinte or loop around 2011-10-10

    I want to make horizontal scroll view infinite or atleast give the effect of being infinite. Any idea how to do so? can we listen to android horizontal scroll view as to when screen is scrolled.Is there any callback method that is called? Can we know

  • Synchronizing two Horizontal Scroll Views in Android 2011-10-24

    I tried following the advice from this post Synchronise ScrollView scroll positions - android but running into a problem. Background - I want a table layout with both horizontal and vertical scrolling, but I want the first row and first column always

  • horizontal scroll view that snaps 2011-11-10

    I am looking for a way so that when I swipe left or right on a horizontal scroll view it will snap to one of the elements in the center, assuming that three elements (in this case a UIImageView) will be shown at once. How do I do this? --------------

  • Scroll view not scrolled inside of Sliding drawer 2012-01-11

    I have a layout of framelayout and inside of this there are 2 child view, Sliding drawer and listview. Inside of the sliding drawer I need a scroll view but when I run it scroll view can not be scrolled. Anyone has the same problem before ? This is m

  • Fixed position for elements inside scroll views in both directions 2012-02-05

    I am building a view in my Android application which should scroll both horizontal and vertical. Therefore I have surrounded my view with a horizontal scroll view and inside this horizontal scroll view I have another scroll view (vertical scroll view

  • How to use scroll view on iPhone? 2009-03-06

    I want to display a text with a lot of lines. I added a multiline-label to a scroll view, but it didn't show anything. Looks like this is not the correct way to use the scroll view. How to use scroll view so that users can drag down to see more text?

  • FlowDocumentReader scroll bar visibility in Scroll viewing mode 2009-05-07

    I need to show FlowDocument with font size slider and search button. FlowDocumentReader in Scroll viewing mode does exactly what I want, except that it always shows vertical scroll bar, whereas I need to show it only when it will be enabled (internal

  • Circular Scroll View 2009-05-28

    I have implemented a circular scroll view. It's working fine , but after sometimes the scroll view delegates are not getting called. I have attached the code , what is the bug in it .... // // MyScrollViewViewController.h // MyScrollView // // Create

  • Scroll view touch detection 2009-05-29

    I have a problem in the touchesMoved handler with a view that is added onto a UIScrollView. I add a number of labels to the scroll view. Each of these labels contain some text and, on swiping my finger on the labels, I have to play a specific file fo

  • Is there any way that I can add UIScrollView in another scroll view? 2009-06-15

    ** I had added UIScrollView in another scroll view but its not working. I have also added UITextView in UIScrollView and vice-versa but its not working. If anybody has tried or can give some idea then pls... Thank you in advance. With Regards Gunjan

  • Displaying image on Scroll View 2009-07-22

    I am developing an iPhone application where i want to display three image in each row on scroll view where i need to click action on each image like Photo album in iPhone. I am not getting any sample code. Hoping for help subodh --------------Solutio

  • How to implement very large scrolled view in Cocoa 2009-07-30

    Is it wise to create views in Cocoa that have dimensions around 15000 pixels? (of course only small part of this view will be visible at a time in a NSScrollView) Interface Builder has limit of 10000 pixels in size. Is this an artificial limitation o

  • Regarding Scroll View 2009-08-03

    How to Select the current image in Scroll View and How to save that image(Original Image from My app) to Photo Album of iphone Please help me --------------Solutions------------- To select an image you might want to use the Views touches to sense a t

  • automatic scroll - a scroll view on Touch of textField - iPhone 2009-08-04

    I have many textfields in my Application which are in a scrollview. What i need is when user touches on a textfield, scrollview should scroll in such a way, so that that textfield should not be behind the keyboard. i have seen these sample code site.

  • Scrolling view like app details screen 2009-08-31

    I am trying to figure out the best way to create a view like the app details screen in the AppStore app. I want a thumbnail and text content under it that all scrolls if the content is too long. Is this done in a tableview or a scrollview? ----------

Copyright (C), All Rights Reserved.

processed in 1.401 (s). 13 q(s)