uipageviewcontroller

How to change shadow background white to other colors

左心房为你撑大大i 提交于 2019-11-30 09:27:45
I'm trying to change UIPageViewController shadow color while doing a flip animation. But always it displaying white color only. How to change a color of flip side background color white to other colour like (black or sephia). iBook is doing same thing. I mention that below image have white bg that color i would to change. Screenshot: - (void) renderPageAtIndex:(NSUInteger)index inContext:(CGContextRef)ctx { UIImage *image = [images objectAtIndex:index]; CGRect imageRect = CGRectMake(0, 0, image.size.width, image.size.height); CGAffineTransform transform = aspectFit(imageRect,

Swift iOS: how to trigger next page using buttons

雨燕双飞 提交于 2019-11-30 07:01:16
问题 I have a QuizViewController which extends UIViewController , UIPageControllerDelegate , and a UIPageViewControllerDataSource . Inside QuizViewController.swift private var pageViewController: UIPageViewController? private func createPageViewController() { let pageController = self.storyboard!.instantiateViewControllerWithIdentifier("QuizPageViewController") as! UIPageViewController pageController.dataSource = self if pageInfo.count > 0 { let firstController = getItemController(0)! let

Dynamically reload UIPageViewController after dataSource changed

ε祈祈猫儿з 提交于 2019-11-30 05:21:24
问题 so I'm trying to create an ibooks-like reader and I need to update the contents of the UIPageViewController dynamically after I get the data from the webservice. For a long series of reasons I have to instantiate it at the beginning and then update it when the data comes. I'm creating it like this: NSDictionary *options = [NSDictionary dictionaryWithObject: [NSNumber numberWithInteger:UIPageViewControllerSpineLocationMin] forKey: UIPageViewControllerOptionSpineLocationKey]; self

Child View Controller shifts down

淺唱寂寞╮ 提交于 2019-11-30 04:12:06
问题 I have a TutorialsViewController that has a PageViewController added programmatically as: - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. // Create page view controller self.pageViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"TutorialsPageViewController"]; self.pageViewController.dataSource = self; TutorialsContentViewController *startingViewController = [self viewControllerAtIndex:0]; NSArray *viewControllers = @

UIPageViewController and UIPageControl transparent background color - iOS

白昼怎懂夜的黑 提交于 2019-11-30 03:18:57
问题 I'm making a tutorial when app launches for the first time and using UIPageViewController for that. Everything is working fine but the background color of UIPageViewController is not getting transparent. It's always black, as shown below: Here's how I'm adding the UIPageViewController (in a tabbar controller) .h file: @interface CHMainTabViewController : UITabBarController <UIPageViewControllerDataSource> @property (strong, nonatomic) UIPageViewController *pageViewController; @end .m file (in

How to solve “Failed to determine navigation direction for scroll” bug

血红的双手。 提交于 2019-11-30 01:33:22
My most frequent bug has "Failed to determine navigation direction for scroll" for reason, any idea about how I could solve it? Here is the last Exception Backtrace: 1. CoreFoundation __exceptionPreprocess + 131 2. libobjc.A.dylib _objc_exception_throw + 39 3. CoreFoundation +[NSException raise:format:] + 1 4. Foundation -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 91 5. UIKit __54-[_UIQueuingScrollView _didScrollWithAnimation:force:]_block_invoke + 221 6. UIKit -[_UIQueuingScrollView _didScrollWithAnimation:force:] + 567 7. UIKit -[_UIQueuingScrollView

UIPageViewController in iOS6

自古美人都是妖i 提交于 2019-11-29 23:07:58
In iOS6 in the methods viewControllerAfterViewController and viewControllerBeforeViewController if I return nil (for block the page navigation when I am in the first or last page) the app crash with this exception: 'The number of view controllers provided (0) doesn't match the number required (1) for the requested transition' In iOS5 all works good. I had the same issue. I found that the cause was replacing the delegate on the UIPanGestureRecognizer of the UIPageViewController, a no-no really. The pan gesture recognizer was calling an undocumented method _gestureRecognizerShouldBegin: (note

Preloading pages of UIPageViewController

拥有回忆 提交于 2019-11-29 21:55:38
I can't find a good solution to having the UIPageViewController preload the surrounding ViewControllers. Right now what happens is when the user starts to turn the page, nothing happens, the code calls - (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerAfterViewController:(UIViewController *)viewController and once its loaded thennnn it shows the animation. This takes too long and is not smooth. Anyone have a solution? Create a mutable container and when you show the first view, create the two viewController that would be needed if the user pages,

how to pass data from UIPageViewController to child ViewController using delegates

喜夏-厌秋 提交于 2019-11-29 18:21:26
I want to pass data from a UIPageViewController to one of its child ViewControllers . I have a protocol set like so: protocol Delegate : class{ func protocolMethod(count:Int) } And in UIPageViewController : class PageVC : UIPageViewController{ var delegate : Delegate? var count : Int = 1 func classMethod(){ self.displayPageForIndex(5) //this controlls the tranistion to the child ViewController self.delegate?.protocolMethod(count : self.count) } } In the conforming child ViewController : class ChildVC : UIViewController , Delegate{ func protocolMethod(count : Int){ print(count) } override func

How to change shadow background white to other colors

丶灬走出姿态 提交于 2019-11-29 14:43:47
问题 I'm trying to change UIPageViewController shadow color while doing a flip animation. But always it displaying white color only. How to change a color of flip side background color white to other colour like (black or sephia). iBook is doing same thing. I mention that below image have white bg that color i would to change. Screenshot: 回答1: - (void) renderPageAtIndex:(NSUInteger)index inContext:(CGContextRef)ctx { UIImage *image = [images objectAtIndex:index]; CGRect imageRect = CGRectMake(0, 0