uipagecontrol

PageViewController current page index in Swift

徘徊边缘 提交于 2019-12-02 22:06:14
I want to get current index of a pageViewController, I don't know how I get the visible pages index. func pageViewController(pageViewController: UIPageViewController, didFinishAnimating finished: Bool,previousViewControllers: [UIViewController],transitionCompleted completed: Bool) { // How to get it? } You can use didFinishAnimating, and set tags to viewcontrollers. try this func pageViewController(pageViewController: UIPageViewController, didFinishAnimating finished: Bool, previousViewControllers: [UIViewController], transitionCompleted completed: Bool) { if (!completed) { return } self

how do i use a UIPageControl?

回眸只為那壹抹淺笑 提交于 2019-12-02 19:58:18
I am making an app where 10 images can be scrolled through using a page control. The problem is that I have absolutely no idea how to use a page control. Any help at all is appreciated. There is an example here , and you can read the documentation here . Try downloading and running the example, then scanning through the documentation and the source code of the example to get an idea of what it is doing and how to use it. I found the above two links by searching google for "uipagecontrol" and "uipagecontrol example". You basically need to add a scrollView and enable pagination on it. Then add

UIPageControl - Change page on click of button

柔情痞子 提交于 2019-12-02 09:36:58
问题 I am using UIPageControl along with UISwipeGestureRecognizer to switch between view controllers. The pages are changed using swipe. I also need to change the page when a UIButton is pressed on one of the view controllers. Here is how the swipe is used to change the views: - (void)swipeRightToLeftGesture:(UIGestureRecognizer *)gestureRecognizer { if (self.pageControl.currentPage == 0) { [UIView animateWithDuration:1 animations:^{ for (UIViewController *vc in self.childViewControllers) { CGRect

Swift PageControl larger dot on current page

夙愿已清 提交于 2019-12-02 09:09:41
I am attempting to scale dot of the current page to be larger than the dots which are not 'selected'. I am using the scrollview delegate to ascertain which page is current. At the moment there is no change to the size of the dot. How would I go about achieving this? func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) { var i = 0 if(scrollView.contentOffset.x < scrollView.frame.width){ pageControl.currentPage = 0 pageControl.subviews.forEach { if(i == 0){ print("Edit") $0.transform.scaledBy(x: 5, y: 5) } pageControl.layoutIfNeeded() i += 1 } }else{ pageControl.currentPage = 1 } }

iOS - UIButton on UIPageControl not working

[亡魂溺海] 提交于 2019-12-02 08:38:18
I am using UIPageControl as indicator between different page (view controllers) of my application. In each of the view controllers, I need to have a different button on the left corner on the UIPageControl. If I place a UIButton at that position on each of the view controllers, I see it on the UIPageControl but the buttons do not respond to the touch event. Is there something I am missing? Or is there an alternative to do this? Thanks. I guess the page control and the view controller view are both subviews of the same view. In this case, the button is drawn outside of the view controllers view

UIPageControl - Change page on click of button

时光怂恿深爱的人放手 提交于 2019-12-02 06:37:14
I am using UIPageControl along with UISwipeGestureRecognizer to switch between view controllers. The pages are changed using swipe. I also need to change the page when a UIButton is pressed on one of the view controllers. Here is how the swipe is used to change the views: - (void)swipeRightToLeftGesture:(UIGestureRecognizer *)gestureRecognizer { if (self.pageControl.currentPage == 0) { [UIView animateWithDuration:1 animations:^{ for (UIViewController *vc in self.childViewControllers) { CGRect frame = vc.view.frame; frame.origin.x -= self.view.frame.size.height; vc.view.frame = frame; } }];

Customise Position of UIPageControl

雨燕双飞 提交于 2019-12-01 09:29:45
I am using project from github as a reference. project URL: https://github.com/lephuocdai/iOSsample/tree/master/PageViewDemo In this project i want to show the UIPageControl at top left position . I tried setting the rect property of pageControl using CGRectMake() to some value ;But it shows always at bottom center Hussein Dimessi here s a very neat and 100% effective way to get to change the position of the pageControl extension UIPageViewController { override open func viewDidLayoutSubviews() { super.viewDidLayoutSubviews() for subV in self.view.subviews { if type(of: subV).description() ==

Access the UIPageControl created by iOS6 UIPageViewController?

跟風遠走 提交于 2019-12-01 04:46:05
I'm using a UIPageViewController with Navigation set to Horizontal, Transition Style set to Scroll (in InterfaceBuilder), and no spine. Which gives me a lovely UIPageControl integrated. Now I want to be able to toggle whether it's displaying (because there's artwork underneath it). I've tried setting presentationCountForPageViewController and presentationIndexForPageViewController to return 0 when the UIPageControl is supposed to be hidden, but those methods aren't being called when I want. Pausing for stacktrace, I see them being called by [UIPageViewController

WatchKit UIPageControl Dot Colour

懵懂的女人 提交于 2019-12-01 04:11:12
问题 When I was watching one of the videos from Apple about the Apple Watch and its features I noticed that the page indicator dot colours change depending on the page presented. They've also got images of the coloured dots within the Apple Watch Human Interface Guidelines App Anatomy section. Note the coloured title text as well. Normally in WatchKit I would use the following snippet of code to do this: let features = ["First", "Second", "Third"] let controllers = [String](count: features.count,

Navigate to specific page in scrollView with paging, programmatically

大憨熊 提交于 2019-12-01 02:06:22
How do I navigate to a specific page programmatically. Basically I have an app with a scrollView populated with a bunch of subviews (tableViews in this case). When clicking on a subview it zooms in and the user can edit and navigate the table, however when I zoom back out I reload the entire view in case there were any changed made by the user. Of course reloading the view sends the user back to page 0. I've tried setting the pageControl.currentpage property but all that does is change the dot of the pageControl. Does that mean that something is wrong or do I need to do something else as well?