Tag: uipagecontrol

UIPageViewController和UIPageControl透明背景颜色 – iOS

我正在做一个教程,当应用程序首次启动,并使用UIPageViewController 。 一切工作正常,但UIPageViewController的背景颜色不透明。 它总是黑色的,如下所示: 这是我如何添加UIPageViewController (在一个UIPageViewController控制器) .h文件: @interface CHMainTabViewController : UITabBarController <UIPageViewControllerDataSource> @property (strong, nonatomic) UIPageViewController *pageViewController; @end .m文件(在viewDidLoad ): // Create page view controller self.pageViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"PageViewController"]; self.pageViewController.dataSource = self; self.pageViewController.view.backgroundColor = [UIColor clearColor]; TutorialViewController *startingViewController = [self viewControllerAtIndex:0]; NSArray *viewControllers = @[startingViewController]; [self.pageViewController setViewControllers:viewControllers direction:UIPageViewControllerNavigationDirectionForward animated:NO completion:nil]; [self presentViewController:_pageViewController animated:YES completion:nil]; 在我的AppDelegate.m中,我还设置了UIPageControl的背景色: […]

在故事板上的UIScrollView / UIPageControl中推送视图需要帮助

我试图在故事板上用UIPageControl实现UIScrollView来显示多个视图。 我发现的所有示例,教程或信息都是使用xib而不是storyboard。 我试图适应苹果的示例代码,但我错过了一些东西。 正如你所看到的,这很简单。 然而,无论我在ContentController.m中得到一个错误– [NSNull视图]:无法识别的select器发送到实例0x129acd8当我testing如果(controller.view.superview ==零)我推视图(见下面的后半部分码)。 或者只有UIScrollView和UIPageControl正在工作,我无法在UIScrollView中推送视图: 我知道这是一个简单的问题,但是我花了很多时间在这个和任何帮助将不胜感激。 我发布完整的代码,因为它可以帮助某人,当解决像一种教程。 根据贡献,我会根据需要更正代码。 提前致谢 AppDelegate.h // Nothing special as I don't want to manage it through application delegate @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end AppDelegate.m // Nothing special as I don't want to manage it through application delegate #import "AppDelegate.h" @implementation AppDelegate […]

UITableViewController里面的水平分页UIScrollView

这是情况: 我需要水平滚动,并在每个页面内的表视图。 这就像新闻应用程序,它应该显示不同类别的新闻,当滚动一个水平方向,在一个类别内,它应该显示约30消息,当然可以垂直滚动。 我已经成功地完成了我所需要的,但是… 我有以下情况: UINavigationController |__ UIViewController, which contains ScrollView and PageControl |__ UITableViewController, which holds data in rows, and is displayed inside parent, which is actually ScollView 我知道这不是一个理想的解决scheme,但至less是有效的。 作为一个基地,我使用苹果公司的代码和教程在这个链接上find的PageScroll。 而不是简单的viewController添加到ScrollView,我使用TableViewController,所以基本上我把tableController.tableView添加到ScrollView。 我也知道,在scrollview中添加tableViews就是在卡车里面加一辆车,然后驾驶那辆车,但是我找不到更合理的做同样的事情。 所以,我需要你的想法如何使用其他方法可以完成。 我为此使用了故事板和iOS 5,现在一切似乎(并且看起来)都是混乱的。 在此先感谢,很多。

我如何在Swift中实现UIPageControl

好吧,我在这里挣扎,一直没有find一个工作的解决scheme。 我一直在自学Swift没有Objective C的经验(我知道,我知道)。 在我的应用程序中,我有我的主UIViewController ,一个子视图是透明的,但从屏幕底部滑入,然后滑动子视图的所有工作UIScrollViews 4个子视图。 我有分页启用,它工作得很好,但我想为他们每个添加一个UIPageControl。 我认真的抓不住代表,如何实施使用迅捷。 任何帮助将非常感激! 另外,我正在以编程的方式完成这个任务,所以请不要使用IB。 如果能提供帮助,很乐意提供代码。 谢谢

在Swift中的PageViewController当前页面索引

我想获得一个pageViewController的当前索引,我不知道如何得到可见的页面索引。 func pageViewController(pageViewController: UIPageViewController, didFinishAnimating finished: Bool,previousViewControllers: [UIViewController],transitionCompleted completed: Bool) { // How to get it? }

如何在我的应用程序中使用UIPageControl?

我正在做一个应用程序,我需要一些图像可以通过使用UIPageControl滚动。 不幸的是,我不知道如何使用UIPageControl或者UIScrollView。 通过苹果的YouTubevideo或Xcode文档的链接将不胜感激! 提前致谢!!

使用UIPageControl缩小网点大小或填充以适应屏幕上的所有页面指示符

我有一个UIPageControl有22页,因此22个页面指标点。 在iPhone的横向上,它们都是可见的,左侧和右侧有足够的空间,但纵向没有足够的横向空间来显示所有的点(至less在iPhone 4和5上),所以两个点不可见,外面的两个被切成两半。 我正在寻找一种方法来减less点的大小或减less填充点之间的填充量,以确保所有的点在屏幕上适合肖像。 那怎么能做到呢?

如何结合UIScrollview和UIPagecontrol显示不同的视图?

我已经search和search这个教程,但没有一个是我正在寻找。 我试过苹果的样品,但它只是颜色,我不知道如何使它的意见。 我正在寻找的是一个页面显示页面控制的页面。 每次滚动视图页面我想要显示一个完全不同的视图与button,很像iPhone的主屏幕。 我发现下面的示例代码只与图像很好地工作,但我想修改为单独的视图。 请帮忙! 谢谢。 – (void)setupPage { scrollView.delegate = self; [self.scrollView setBackgroundColor:[UIColor clearColor]]; [scrollView setCanCancelContentTouches:NO]; scrollView.indicatorStyle = UIScrollViewIndicatorStyleWhite; scrollView.clipsToBounds = YES; scrollView.scrollEnabled = YES; scrollView.pagingEnabled = YES; NSUInteger nimages = 0; CGFloat cx = 0; for (; ; nimages++) { NSString *imageName = [NSString stringWithFormat:@"image%d.jpg", (nimages + 1)]; UIImage *image = [UIImage […]

有可能使用UIPageControl来控制UITableView的移动吗?

从苹果示例“PageControl”中,我们可以知道UIPageControl可以用来控制滚动视图中页面的移动。 由于UITableView是UIScrollView的子类,我想使用UIPageControl来控制表视图单元格的移动,就像在“PageControl”中一样。 但是找不到代理的任何接口。 问题是: 这是可能的吗? 为什么? 谢谢 让我回答我的问题: 以编程方式select和滚动 清单6-5以编程方式select一行 – (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)newIndexPath { NSIndexPath *scrollIndexPath; if (newIndexPath.row + 20 < [timeZoneNames count]) { scrollIndexPath = [NSIndexPath indexPathForRow:newIndexPath.row+20 inSection:newIndexPath.section]; } else { scrollIndexPath = [NSIndexPath indexPathForRow:newIndexPath.row-20 inSection:newIndexPath.section]; } [theTableView selectRowAtIndexPath:scrollIndexPath animated:YES scrollPosition:UITableViewScrollPositionMiddle]; }

UIPageControl – 点击button更改页面

我使用UIPageControl和UISwipeGestureRecognizer在视图控制器之间切换。 页面使用刷卡进行更改。 我还需要在其中一个视图控制器上按下UIButton时更改页面。 下面是如何使用滑动来改变视图: – (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; } }]; self.pageControl.currentPage = 1; } } 我希望这个问题很清楚。 我尽力说清楚。