uiscrollview

UIScrollview touchesbegan,touchesmoved,touchesended actions

会有一股神秘感。 提交于 2020-01-01 06:28:38
问题 I did this touch actions in UIView, ie, in a uiview there are two or three subviews v1,v2,v3. I used the code below to place the image i1,i2,i3 in corresponding views and if I moves the touch the images move to that point in the view. - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; if ([touch view] == v1) { CGPoint location = [touch locationInView:v1]; i1.center = location; } else if([touch view] == v2) { CGPoint location = [touch

UIScrollview touchesbegan,touchesmoved,touchesended actions

那年仲夏 提交于 2020-01-01 06:27:08
问题 I did this touch actions in UIView, ie, in a uiview there are two or three subviews v1,v2,v3. I used the code below to place the image i1,i2,i3 in corresponding views and if I moves the touch the images move to that point in the view. - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; if ([touch view] == v1) { CGPoint location = [touch locationInView:v1]; i1.center = location; } else if([touch view] == v2) { CGPoint location = [touch

How to make UIButton vertical silder menu in iphone

怎甘沉沦 提交于 2020-01-01 06:26:08
问题 In my application i want to make UIButton slider with scroll view in which when we scroll uiscrollview of buttons then the button will be locate at the center please see these application's first screen sot http://itunes.apple.com/au/app/id422249255?mt=8 how can i do it and what methods i can used for it currently i am used these delegate methods of UIScrollview -(void)scrollViewDidScroll:(UIScrollView *)aScrollView { } (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:

How to make UIButton vertical silder menu in iphone

断了今生、忘了曾经 提交于 2020-01-01 06:26:05
问题 In my application i want to make UIButton slider with scroll view in which when we scroll uiscrollview of buttons then the button will be locate at the center please see these application's first screen sot http://itunes.apple.com/au/app/id422249255?mt=8 how can i do it and what methods i can used for it currently i am used these delegate methods of UIScrollview -(void)scrollViewDidScroll:(UIScrollView *)aScrollView { } (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:

How to pass touches from UIView to UIScrollView

♀尐吖头ヾ 提交于 2020-01-01 05:35:11
问题 Similar to this thread and many others, I've got a view controller with a NIB file which has this layout... a. UIView (480 x 320) - stores a background image b. UIScrollView (480 x 220) - Is a level selector scrollview c. UIView (480 x 320) - contains a foreground animated graphic All three items above are subviews of the main View in the NIB. UIView (c) is the full size of the iPhone screen and on top of the hierarchy. On it, I've placed a character which animates based on the current touch

iOS: UIScrollView detecting Swipe Gesture

不问归期 提交于 2020-01-01 05:22:07
问题 I have an UIScrollView which scrolls automatically by using a timer, which scrolls every 3 seconds to the next page (kind of slideshow). Now I want to implement a function which detects any user interaction, to cancel the timer as soon as the user interacts with the scrollview, so that he can scroll through the scrollview by himself. What would be the best way to do this? The ScrollView isn't subclassed and is using the UIScrollViewDelegate. Would be glad for some hints. Cheers. 回答1:

Is it possible to have a UIImageView inside of a UIScrollView zoom in and out, but stick to center with Auto Layout?

a 夏天 提交于 2020-01-01 05:04:12
问题 Long story short, I'm trying to build functionality similar to Photos.app. I have a UIScrollView with a UIImageView inside of it set up in the Storyboard. Zooming works, but I'm having trouble keeping it centered. In all my frame based scroll view implementations I've centered it as follows, which works beautifully: - (void)scrollViewDidZoom:(UIScrollView *)scrollView { CGRect newImageViewFrame = self.imageView.frame; // Center horizontally if (newImageViewFrame.size.width < CGRectGetWidth

Problem detecting if UITableView has scrolled to the bottom

て烟熏妆下的殇ゞ 提交于 2020-01-01 04:44:04
问题 I'm using the following code to detect if I've reached the bottom of a UITableView - (void)scrollViewDidScroll:(UIScrollView *)scrollView{ if(self.tableView.contentOffset.y >= (self.tableView.contentSize.height - self.tableView.bounds.size.height)) { NSLog(@"bottom!"); NSLog(@"%@", [self getLastMessageID]); [self getMoreStuff:[self getLastMessageID]]; } } This works fine, but the only problem is when the user is pulling the tableview down (like pull to refresh) the code fires. How can I

How to center content in a UIScrollView with contentOffset

試著忘記壹切 提交于 2020-01-01 04:09:05
问题 This should be a VERY easy problem but I'm having trouble getting the desired result. I have horizontally scrolling UIScrollView with a width of 320. The width of its content is 5000. I'm trying to center the content with: // 'self' is the UIScrollView CGFloat newContentOffsetX = (self.width/2) + (self.contentSize.width/2); self.contentOffset = CGPointMake(newContentOffsetX, 0); I don't understand why this is not centering the content. Can you see something wrong with the calculations? 回答1: I

UIScrollview zoom and enable paging simultaneously

走远了吗. 提交于 2020-01-01 03:37:28
问题 Can i implement both the paging and zooming of imageview in a uiscrollview at the same time. 回答1: Yes. You can do it. In each page of the mainScrollView add a subScrollView containing the imageView . You need to do the following things. Set maximumZoomScale for subScrollView [subScrollView setMaximumZoomScale:2.0f]; // You can set any value This value is calculated based on the size of the image displayed in the imageView. In the viewForZoomingInScrollView: method of the subScrollView return