uiscrollview

IOS - Centering UIScrollView inside UIView container programmatically with Autolayout issue

我只是一个虾纸丫 提交于 2019-12-11 20:35:58
问题 I'm trying to replicate the safari pages scrollview, which has its frame that is slightly narrower than iPhone screen. So According to few suggestions I'm placing a the scrollview (450x280 points) inside a "clipView" (450x320 points). //viewController methods -(void)viewDidAppear:(BOOL)animated{ CGRect pagingScrollViewFrame = self.clipview.frame; pagingScrollViewFrame.size.width = 280; NSLog(@"clipview h:%f e w:%f",self.clipview.frame.size.height,self.clipview.frame.size.width); NSLog(@

scroll the text inside a UIScrollView

拈花ヽ惹草 提交于 2019-12-11 20:34:46
问题 I have a controller view, that includes, (image, and text). the two components are in UIScrollView , the image is UIImageView , and the text is UITextView (scroll is enabled). while i am trying to scroll the whole screen, the text doesn't scroll with it, because it has its own scroll. what I need is to scroll the text with the whole screen scroller. (Merge the scroll of the text with the scroll of the whole one). should I change the type of text to label instead of textview or what should I

Limit touches recognized on UIScrollView

心不动则不痛 提交于 2019-12-11 20:23:38
问题 I'm trying to limit the number of touches recognised on a UIScrollView as it's executing with another gesture that has more than one touch required. I don't want the pan & swipe gestures to fire if the number of touches is greater than 1. But I'm having no success. I've subclassed the UIScrollView and overridden the obvious methods, but numberOfTouches always returns 1? -(BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer { if (gestureRecognizer.numberOfTouches > 1) {

How can I let UIScrollView (pagingEnabled) to move 1.2 page each time?

笑着哭i 提交于 2019-12-11 20:13:08
问题 Ok. here is the story: I have a UIWebView in full screen, width = 768 It loads several images and those images are in one line, which means the UIWebView will scroll only horizontally. Now, I set the UIScrollView inside the UIWebView to pagingEnabled = YES. So the scroll on the UIWebView will move page by page. The problem is that every image's width is about 900. I won't scale them down and if I scroll the UIWebView, from the 2nd page on, always 132points of previous image will show. This is

Scrollable all the way UITableView

心已入冬 提交于 2019-12-11 19:27:54
问题 I have this code linked to a button on a ViewController with a UITableView as subview: -(IBAction)Action:(id)sender{ [tableView setContentSize:CGSizeMake(320, 1000)]; } This makes tha tableView scrollable to the bottom so that I can use a couple of buttons I programatically added to the bottom. So far so good. However, I want the tableView to be ok from the beginning, so I added the code inside viewDidLoad. Surprisingly, it doesn't work at all. Could somebody give me a hand? thanks! 回答1: If

iPhone: Expand UITextView when scrolling

允我心安 提交于 2019-12-11 19:25:01
问题 in my iPhone Application I have a UIImageView on the top and a UITextView below that. I want the UITextView to expand to the upper site and cover the UIImageView once the User starts scrolling. A similar effect can be found in the Rdio Application. There you can view the cover on the top and the upcoming title below, once the user starts to scroll, the upcoming titles view expands and covers the cover. How can that be done? Thanks. 回答1: Try to use one of the delegate methods of UIScrollView

detect image object user is viewing in scrollviewdidscroll

时间秒杀一切 提交于 2019-12-11 19:14:04
问题 How can i detect which image object user is on? Trying to do it this way but it is not working - (void)scrollViewDidScroll:(UIScrollView *)sender { // [_imageScrollView contentOffset]; CGFloat imageViewWidth = _imageScrollView.frame.size.width; //int currentPage = floor((_imageScrollView.contentOffset.x - pageWidth / 2) / pageWidth) + 1; NSInteger image = (NSInteger)floor((self.imageScrollView.contentOffset.x * 2.0f + imageViewWidth) / (imageViewWidth * 2.0f)); [_imageScrollView contentOffset

UITableView landscape scrolling issue

折月煮酒 提交于 2019-12-11 19:06:44
问题 A little background: My app is designed as a web form in a UITableView. It is similar in format to the iPhone's Settings > Mail,Contacts,Calendars > "Account Name" > Account Info. A few differences: 1) I have a big text box on the bottom where you can put a "message body". 2) I have a big red button underneath the text box, similar to the red "Delete Account" button at Settings > Mail,Contacts,Calendars > "Account Name". the red button button submits the "form". The view described above fits

Zoom in Scroll view with UIImage

試著忘記壹切 提交于 2019-12-11 18:53:33
问题 Im trying to zoom in a scroll view with multiple images, the scroll view only scrolls vertical, i tried to implement many ways, in many examples but none seens to work. Heres the code im using to create the images and the scroll view: - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view from its nib. for (int i = 0; i < 6; i++) { UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"amap1%i.png",i+1]]; // create imageView _imageView = [

Objective C: Drawing with Fingers on UIScrollView

早过忘川 提交于 2019-12-11 18:51:36
问题 I am trying to make a sketch pad app. I used UIScrollView for paging and UIImageView for the drawing. I put the UIImageView on top of the scrollView but it's not added to UIScrollView so it will not scroll. The issue now... It's not writing when... [scrollView setScrollEnable:YES]; [scrollView setUserInteractionEnabled:YES]; i need to set it to NO with the use of a button for it to write, is there a way that i can scroll and write at the same time without using any button?? 回答1: This is