contentoffset

iOS 8.4: Scroll view resets contentOffset with Voice Over enabled shortly after view appear

被刻印的时光 ゝ 提交于 2020-06-24 13:42:47
问题 With Voice Over enabled scroll views reset their preset contentOffset a second after view did appear. It happens on iOS 8.4 devices, no reproduction for 9.0. Looks some internal UIScrollViewAccessibility code forces scroll view to setContent: for zero when becoming focused. Didn't find any way to evade this. Any thoughts? Related code sample illustrates the bug. Just create a view with collection view, create a cell with reuse id "Cell" and put a label on it. @interface ViewController ()

iOS 8.4: Scroll view resets contentOffset with Voice Over enabled shortly after view appear

拟墨画扇 提交于 2020-06-24 13:42:21
问题 With Voice Over enabled scroll views reset their preset contentOffset a second after view did appear. It happens on iOS 8.4 devices, no reproduction for 9.0. Looks some internal UIScrollViewAccessibility code forces scroll view to setContent: for zero when becoming focused. Didn't find any way to evade this. Any thoughts? Related code sample illustrates the bug. Just create a view with collection view, create a cell with reuse id "Cell" and put a label on it. @interface ViewController ()

contentoffset in scrollview

谁说胖子不能爱 提交于 2020-01-25 11:01:06
问题 How can i set the contentoffset for image to track down which image user is on and selected to save it to phot album. UIScrollView *imageScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)]; imageScrollView.pagingEnabled = YES; NSInteger numberOfViews = 61; for (int i = 0; i < numberOfViews; i++) { CGFloat xOrigin = i * self.view.frame.size.width; NSString *imageName = [NSString stringWithFormat:@"image%d.png", i]; _image

How to Programmatically Scroll iOS WKWebView, swift 4

我怕爱的太早我们不能终老 提交于 2020-01-15 09:43:34
问题 So my question is: After a website(any websites on the www) has been loaded up in my iOS webview app how to make the app Programmatically Scroll vertically to any of the contents thats out of view? // ViewController.swift // myWebView import UIKit import WebKit class ViewController: UIViewController, WKNavigationDelegate { @IBOutlet weak var myWebView: WKWebView! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. }

UICollectionView contentOffset changes with custom layout

妖精的绣舞 提交于 2020-01-12 04:20:07
问题 I have a UICollectionView with a custom UICollectionViewLayout (actually, I'm using this nice layout). I set contentOffset = CGPointZero in viewDidLoad. After viewDidLoad, however, the offset is -20, and the content gets pushed down like so: (It should be flush with the line). I'm loading the collection view layout in interface builder. It seems that my problem is very similar to this one, however the solutions there don't work for me. I tried modifying collectionViewContentSize in my layout

iOS UIScrollView/UITableView contentOffset gets reset when pushViewControllerAnimated:

元气小坏坏 提交于 2020-01-04 19:58:38
问题 I have a simple UIViewController with a UITableView as its view 's subview . I want to have the option to hide the tableViewHeader of my tableview. This is working fine - I can adjust the content offset with the height of the headerView and its all good. However, when I am to transition to a new VC (by pushing) - during the transition animation the tableView's contentOffset gets reset to {0,0} - essentially showing the header view. Is there a way I can keep the contentOffset of the tableView

iOS UIScrollView/UITableView contentOffset gets reset when pushViewControllerAnimated:

会有一股神秘感。 提交于 2020-01-04 19:58:13
问题 I have a simple UIViewController with a UITableView as its view 's subview . I want to have the option to hide the tableViewHeader of my tableview. This is working fine - I can adjust the content offset with the height of the headerView and its all good. However, when I am to transition to a new VC (by pushing) - during the transition animation the tableView's contentOffset gets reset to {0,0} - essentially showing the header view. Is there a way I can keep the contentOffset of the tableView

contentOffset is reset on ScrollView header when vertical scrolling in UITableView

江枫思渺然 提交于 2019-12-23 20:21:57
问题 Im making use of this code to align a load of truckDayScrollViews (Subclass of UIScrollView) horizontally in a UITableView, SUDaysForTruckView is just a custom UILabel -(void)scrollViewDidScroll:(UIScrollView *)scrollView { if ([scrollView isKindOfClass:[SUDaysForTruckView class]]) { CGPoint offset=CGPointMake(scrollView.contentOffset.x, 0); for (TruckViewCell *cell in self.tableView.visibleCells) { cell.truckDayScrollView.contentOffset=offset; } self.headerView.contentOffset=offset; self

Changing between colors based on UIScrollView's contentOffset

心已入冬 提交于 2019-12-19 08:29:21
问题 I have a horizontal UIScrollView that has a width of 960 , enough to hold 3 UIViewController view's. Each view simply has a background color. The first is pink, the second is blue, and the third is green. I want to blend/mix/fade the visible colors together as the user scrolls. So if you were scrolling from page 1 (pink) to page 2 (blue), there would be some type of mix/blend/fade of pink and blue before finally landing on the final blue color when the user fully swiped to the 2nd page. I

UIScrollview animation depending on content offset

北城以北 提交于 2019-12-18 12:37:41
问题 I'm using a horizontal UIScrollView, and I want a background color transition depending on the x value of the content offset. Example: The width of UIScrollView is 640px. When the content offset is equal to 0px, the background color must be red. When the content offset is 320 px, the background must be yellow. But the most important part is, when the UIScrollview is between 0px and 320px the background color must be between red and yellow. Hint: The twitter app for iOS has the same animation