Search Results

Search found 393 results on 16 pages for 'uiscrollview'.

Page 10/16 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • determine if point on screen is within specific UIScrollView subview

    - by Kyle
    A UIScrollView contains several UIView objects; how can I tell if a point on the screen not generated by touches is within a specific subview of the scrollview? so far atempts to determine if the point is in the subview always return the first subview in the subviews array of the parent scrollview, ie the coordinates are relative to the scrollview, not the window. Here's what I tried (edited) -(UIView *)viewVisibleInScrollView { CGPoint point = CGPointMake(512, 384); for (UIView *myView in theScrollView.subviews) { if(CGRectContainsPoint([myView frame], point)) { NSLog(@"In View"); return myView; } } return nil; }

    Read the article

  • UITextView autoscroll to last line

    - by MihaiD
    Hi *, When writing in a UITextView more text than can fit entirely inside it, the text will scroll up and the cursor will often place itself one or two lines above the view's bottom line. This is a bit frustrating as I want my application to make good use of the entire height of the text view. Basically what I want is to configure the UITextView to write up to it's lowest part and not use it just for scrolling. I've seen some similar questions here, here and here. However I've not seen a proper solution yet. Thanks

    Read the article

  • UITableView scrolling to specific position

    - by Dave
    I am using iPhone SDK 3.1.3. I have a UITableViewController which gets data from another controller. The tableview is added as a subview to the mainview but the frame is set so that it is not visible. The tableview frame is updated and made to slide over the main view by tapping on a button. The table view appears and i scroll to the last row. if i select the last row, i reload the table with more data. The table gets updated with more data. everything works fine except the scroll position is always the top. I need the scroll position to be the last row that I clicked on to load more data. I save the scroll position and call the following code after it loads more data. It executes without issues but the scroll position is always the top. [theTableView scrollTRowAtIndexPath:[NSIndexPath indexPathForRow:savedScrollPosition inSection:0] atScrollPosition:savedScrollPosition animated:NO]; The above seems to have no effect. ViewWillAppear: ViewDidAppear: does not fire and I am told that if the view controller is instantiated in code, which is the case, these don't fire.

    Read the article

  • iphone app scroll view is horizontal but i want it vertical - how do i change this?

    - by Billy Jones
    Hi Folks, Got this code for a viewscroller from the apple developers site. @synthesize scrollView1, scrollView2; const CGFloat kScrollObjHeight = 467.0; const CGFloat kScrollObjWidth = 320.0; const NSUInteger kNumImages = 6; (void)layoutScrollImages { UIImageView *view = nil; NSArray *subviews = [scrollView1 subviews]; // reposition all image subviews in a horizontal serial fashion CGFloat curXLoc = 0; for (view in subviews) { if ([view isKindOfClass:[UIImageView class]] && view.tag 0) { CGRect frame = view.frame; frame.origin = CGPointMake(curXLoc, 0); view.frame = frame; curXLoc += (kScrollObjWidth); } } // set the content size so it can be scrollable [scrollView1 setContentSize:CGSizeMake((kNumImages * kScrollObjWidth), [scrollView1 bounds].size.height)]; } it works brilliantly the images are rotated by pulling them left or right. but I want to pull the images up and down to change them. Can anyone help me out with this? this part in the code looks as if it controls the direction but i'm not sure how to change it. // reposition all image subviews in a horizontal serial fashion CGFloat curXLoc = 0; for (view in subviews) { if ([view isKindOfClass:[UIImageView class]] && view.tag 0) { CGRect frame = view.frame; frame.origin = CGPointMake(curXLoc, 0); view.frame = frame; curXLoc += (kScrollObjWidth); } } Any help most appreciated, thanks! Billy

    Read the article

  • UIWebView - get total height of contents using Javascript

    - by Emil
    Hey. I'm trying to use a UIWebView for displaying content higher than the screen of the iPhone, without needing to scroll in the webView itself. For that, I need a way to get the total document size, including the scrollable area. I have tried a number of different Javascript solutions: (document.height !== undefined) ? document.height : document.body.offsetHeight // Returns height of UIWebView document.body.offsetHeight // Returns zero document.body.clientHeight // Returns zero document.documentElement.clientHeight // Returns height of UIWebView window.innerHeight // Returns height of UIWebView -2 Can you think of any other way to do it? Thanks.

    Read the article

  • How to scroll programmetically to selected cover in coverflow view ?

    - by hib
    Hi all , I am using a coverflow component for my application . It is working nicely till now . But now I want to scroll to selected cover in coverflow . I am currently doing this : TKCoverView *cover = [self.coverflow coverAtIndex:currentIndex]; CGRect frame = cover.frame ; frame.origin.x = frame.origin.x * 1.2; // **main setting** [self.coverflow bringCoverAtIndexToFront:currentIndex animated:YES]; [self.coverflow scrollRectToVisible:frame animated:YES]; and the cover At index method - (TKCoverView*) coverflowView:(TKCoverflowView*)coverflowView coverAtIndex:(int)index{ TKCoverView *cover = [coverflowView dequeueReusableCoverView]; NSLog(@"Index value :%i",index); if(cover == nil){ cover = [[[TKCoverView alloc] initWithFrame:CGRectMake(0, 0, 224, 300)] autorelease]; // 224 cover.baseline = 224; cover.image = [UIImage imageNamed:@"Placeholder_2.png"]; cover.tag = index; }else { cover.image = ((object *)[array objectAtIndex:index]).appIconNormal; } return cover; and - (TKCoverView*) dequeueReusableCoverView{ if(yard == nil || [yard count] < 1) return nil; TKCoverView *v = [[[yard lastObject] retain] autorelease]; v.layer.transform = CATransform3DIdentity; [yard removeLastObject]; return v; } So can any one tell me what is the perfect and standard way of setting the frame for the scrollRectToVisibleRegion method .

    Read the article

  • Scrolling png with text & alpha on top of a static UIImageView

    - by heymon
    I have a view controller that has a view structure as follows: FilesOwner FirstResponder View ImageView (.jpg) ScrollView ImageView (.png) The text in the innermost imageview has white text and clear (alpha) all around. I want to scroll the innermost imageview, and see the background image (the .jpg) behind it. Its not working. Its acting like the scrollview background obscures the underneath .jpg. I say this because if I change the background color of the scrollview, that's what I see i.e. if I set it black, I see black behind my .png, if I set it white, I see white. If I change the alpha of the scrollview that doesn't seem to work either. The one other thing I tried was unchecking drawing: Opaque, but that doesn't get it either.

    Read the article

  • UIView coordinate transforms on rotation during keyboard appearance

    - by SG
    iPad app; I'm trying to resize my view when the keyboard appears. It amounts to calling this code at appropriate times: CGRect adjustedFrame = self.frame; adjustedFrame.size.height -= keyboardFrame.size.height; [self setFrame:adjustedFrame]; Using this technique for a view contained in a uisplitview-based app works in all 4 orientations, but I've since discovered that a vanilla uiview-based app does not work. What happens is that apparently the uisplitview is smart enough to convert the coordinates of its subviews (their frame) such that the origin is in the "viewer's top left" regardless of the orientation. However, a uiview is not able to correctly report these coordinates. Though the origin is reported as (0,0) in all orientations, the view's effective origin is always as if the ipad were upright. What is weird about this is that the view correctly rotates and draws, but it always originates in the literal device top left. How can I get the view to correctly make its origin the "top left" to the viewer, not the device's fixed top left? What am I missing? Please, for something so trivial I've spent about 6 hours on this already with every brute force technique and research angle I could think of. This is the original source which doesn't work in this case: http://stackoverflow.com/questions/1951826/move-up-uitoolbar

    Read the article

  • Initialization of controllers in a for loop - leaking problem ?

    - by gotye
    Hey, I am creating a kinda gallery and for each gallery I created a view controller whose view is added to a scrollview (see code below) : GalleryViewController *galViewController; for (NSUInteger i = 0 ; i < [galleries count]; i++) { galViewController = [[GalleryViewController alloc] init]; galViewController.record = [galleries objectAtIndex:i]; //galViewController.position = i; galViewController.view.frame = CGRectMake(i%3*100,i/3*150,100,150); [galViewController setDelegate:self]; [self.scrollView addSubview:galViewController.view]; //[galViewController release]; } Is this code leaking ? I think so ... but the thing is that I don't know what to do with these controllers ... i can't release them (cause I got some code to use in the future like touches event) and I don't need to save them somewhere ... Is this a problem to have this kind of code ? Thks, Gotye

    Read the article

  • How to disable multiple touches on a ScrollView and UIImage

    - by Rob
    I have a scrollview that I am loading images into that the user can touch and play a sound. However, the program is getting confused when I press one image with one finger and then another one with a different finger. It thinks you are pushing the same button again and therefore plays the sound again (so you have two of the same sounds playing at the same time even though you may have pressed a different sound button). I tried setting exclusiveTouch for each UIImage but that didn't seem to work in this case for some reason. What am I missing or is there a better way to do this? Here is some code: for creating buttons.... - (void) createButtons { CGRect myFrame = [self.outletScrollView bounds]; CGFloat gapX, gapY, x, y; int columns = 3; int myIndex = 0; int viewWidth = myFrame.size.width; int buttonsCount = [g_AppsList count]; float actualRows = (float) buttonsCount / columns; int rows = buttonsCount / columns; int buttonWidth = 100; int buttonHeight = 100; if (actualRows > rows) rows++; //set scrollview content size to hold all the glitter icons library gapX = (viewWidth - columns * buttonWidth) / (columns + 1); gapY = gapX; y = gapY; int contentHeight = (rows * (buttonHeight + gapY)) + gapY; [outletScrollView setContentSize: CGSizeMake(viewWidth, contentHeight)]; UIImage* myImage; NSString* buttonName; //center all buttons to view int i = 1, j = 1; for (i; i <= rows; i++) { //calculate gap between buttons gapX = (viewWidth - (buttonWidth * columns)) / (columns + 1); if (i == rows) { //this is the last row, recalculate gap and pitch gapX = (viewWidth - (buttonWidth * buttonsCount)) / (buttonsCount + 1); columns = buttonsCount; }//end else x = gapX; j = 1; for (j; j <= columns; j++) { //get shape name buttonName = [g_AppsList objectAtIndex: myIndex]; buttonName = [NSString stringWithFormat: @"%@.png", buttonName]; myImage = [UIImage imageNamed: buttonName]; TapDetectingImageView* imageView = [[TapDetectingImageView alloc] initWithImage: myImage]; [imageView setFrame: CGRectMake(x, y, buttonWidth, buttonHeight)]; [imageView setTag: myIndex]; [imageView setContentMode:UIViewContentModeScaleToFill]; [imageView setUserInteractionEnabled: YES]; [imageView setMultipleTouchEnabled: NO]; [imageView setExclusiveTouch: YES]; [imageView setDelegate: self]; //add button to current view [outletScrollView addSubview: imageView]; [imageView release]; x = x + buttonWidth + gapX; //increase button index myIndex++; }//end for j //increase y y = y + buttonHeight + gapY; //decrease buttons count buttonsCount = buttonsCount - columns; }//end for i } and for playing the sounds... - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { //stop playing theAudio.stop; // cancel any pending handleSingleTap messages [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(handleSingleTap) object:nil]; UITouch* touch = [[event allTouches] anyObject]; NSString* filename = [g_AppsList objectAtIndex: [touch view].tag]; NSString *path = [[NSBundle mainBundle] pathForResource: filename ofType:@"m4a"]; theAudio=[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL]; theAudio.delegate = self; [theAudio prepareToPlay]; [theAudio setNumberOfLoops:-1]; [theAudio setVolume: g_Volume]; [theAudio play]; } - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { BOOL allTouchesEnded = ([touches count] == [[event touchesForView:self] count]); if (allTouchesEnded) { //stop playing theAudio.stop; }//end if //stop playing theAudio.stop; }

    Read the article

  • how do i add two delegates to a ui element at run time?

    - by Michael Xu
    Hi everyone, im trying to implement some behaviors when a mapview element scrolls... by coding a delegate for the scrollview inside of a mapview. so, right now, i got a pointer to the scroll view used by the map view in my code. however, i wish to set the delegate of this scroll view inside the map view, but the issue is that the mapview already sets up a default delegate for this scroll view inside the map view. can i make my delegate implement all of the messages of the protocol, explicitly sending them to the mapview's default delegate while also implementing my own behaviors? how else can i go about adding my own delegate behavior, to an already existing default delegate....? thanks everyone, michael

    Read the article

  • How to use scroll view on iPhone?

    - by iPhoney
    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?

    Read the article

  • iPhone: contentInset isn't animating

    - by Cuzog
    In my app, I have a table view. When the user clicks a button, a UIView overlays part of that table view. It's essentially a partial modal. That table view is intentionally still scrollable while that modal is active. To allow the user to scroll to the bottom of the table view, I change the contentInset and scrollIndicatorInsets values to adjust for the smaller area above the modal. When the modal is taken away, I reset those inset values. The problem is that when the user has scrolled to the bottom of the newly adjusted inset and then dismisses the modal, the table view jumps abruptly to a new scroll position because the inset is changed instantly. I would like to animate it so there is a transition, but the beginAnimation/commitAnimations methods aren't affecting it for some reason. Any ideas as to why the values aren't getting animated? Any help is greatly appreciated! The relevant code from the table view controller is here: - (void)viewDidLoad { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(modalOpened) name:@"ModalStartedOpening" object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(modalDismissed) name:@"ModalStartedClosing" object:nil]; [super viewDidLoad]; } - (void)modalOpened { [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.5]; [UIView setAnimationDelegate:self]; self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 201, 0); self.tableView.scrollIndicatorInsets = UIEdgeInsetsMake(0, 0, 201, 0); [UIView commitAnimations]; } - (void)modalDismissed { [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.5]; [UIView setAnimationDelegate:self]; self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0); self.tableView.scrollIndicatorInsets = UIEdgeInsetsMake(0, 0, 0, 0); [UIView commitAnimations]; }

    Read the article

  • Binding data to scroll view

    - by Rahul Varma
    Hi, I am new to iphone dev. I have a Label and a scroll view. I am trying to get data from url and bind it to label and a scroll view. I am able to bind the data to label by using... UrlValues *asana=[[data yoga]objectAtIndex:i]; self.AsanaName.text = [asana asanatitle]; Similarly i want to bind some other data in the url to a scroll view. The data i want to bind is 4 or 5 sentences. So, can anyone help me how to do it... Any sample code will be really helpful... Thanks

    Read the article

  • Pinterest Gridview implementation on iOS

    - by Amal
    I want to implement a grid view like the one in Pinterest I thought about implementing as 3 table views. But I was not able to scroll them together well. When I implemented the scrollViewDidScroll and set the contentOffset for the table views other the scrollView , the scrolling became slow and unusable. Another implementation I did was of was having a set of images to load and calling the viewDraw function in scrollViewDidScroll. THe ViewDraw function just draws the necessary images and removes the rest of the images from the memory which were already drawn but wont be visible . this too makes the ScrollView Scrolling slow. And another issue with it is that there are white(background color) patches before the images are drawn. What should be the best way to implement this grid view ?

    Read the article

  • iPhone: Can't animate contentInset while animating Nav Bar show/hide

    - by Cuzog
    In my app, I have a table view. When the user clicks a button, a UIView overlays part of that table view. It's essentially a partial modal. That table view is intentionally still scrollable while that modal is active. To allow the user to scroll to the bottom of the table view, I change the contentInset and scrollIndicatorInsets values to adjust for the smaller area above the modal. When the modal is taken away, I reset those inset values. The problem is that when the user has scrolled to the bottom of the newly adjusted inset and then dismisses the modal, the table view jumps abruptly to a new scroll position because the inset is changed instantly. I would like to animate it so there is a transition, but the beginAnimation/commitAnimations methods aren't affecting it for some reason. Edit: More info. I found the conflict. When presenting the modal, I also hide the navigation bar. The navigation bar natively animates the table view up and down as it shows and hides. When I stop animating the navigation bar, the inset animation works fine. Does anyone know what I can do to work around this conflict? Do I have to wait for the navigation bar animation to finish before adjusting the inset? If so, how to I hook onto that? Any help is greatly appreciated! The relevant code from the table view controller is here: - (void)viewDidLoad { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(modalOpened) name:@"ModalStartedOpening" object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(modalDismissed) name:@"ModalStartedClosing" object:nil]; [super viewDidLoad]; } - (void)modalOpened { [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.5]; [UIView setAnimationDelegate:self]; self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 201, 0); self.tableView.scrollIndicatorInsets = UIEdgeInsetsMake(0, 0, 201, 0); [UIView commitAnimations]; } - (void)modalDismissed { [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.5]; [UIView setAnimationDelegate:self]; self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0); self.tableView.scrollIndicatorInsets = UIEdgeInsetsMake(0, 0, 0, 0); [UIView commitAnimations]; }

    Read the article

  • Loading different portrait/landscape UIViews

    - by Tronic
    Hi, I have following View COntroller structure: ScrollViewController LandscapeViewController PortraitViewController Each with its own .nib The app starts in landscape mode where many landscape views are added to a scrollview. Each landscape view has its specific portrait view, so I have to assign like ID's to each of this views. Can you tell me, how I can load the specific portrait view for each landscape view when rotating the device? Do I have to make two scroll views? One for landscape, one for portrait? Or is it possible to just scroll through the landscape scrollview an load just one portrait view with the right content based on an ID? How could I implement that? The data comes from a property list. Thanks in advance!

    Read the article

  • Displaying very large images on the iPad

    - by Brodie4598
    I need to display some very large images on the iPad. The files are jpgs and are about 6700x2700 (maps). Is there any way around loading the entire image into memory? Currently I load it int a scroll view for zooming/panning. The images are stored locally on the device.

    Read the article

  • Progressive download of images in a UITableView

    - by ncohen
    Hi everyone, I'm developing on the iPhone and I have seen in the AppStore that the images are progressively downloaded in the UITableView... How can I implement that? My idea was to detect the showed content (which cells are shown) and download these images. My problem is that I don't know how to detect the showed cells! Is it the good way to do it? Best

    Read the article

  • How much difference you find between scrollview offset and contentview offset of table?

    - by neha
    Hi all, In my application, I want to detect the end of the entire table with scrollview. Since there're no sections in my scrollview, I'm using noOfRows*rowHeight to reach the end. I'm using scrollview.contentOffset.y to detect the y offset, but this contentOffset isn't matching the multiplication result i.e. I have 20 rows and with height as 250. So it comes as 5000, but my scrollview.offset.y at the end of last cell is nearly about 4650. What's this difference? Thanx in advance.

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16  | Next Page >