我使用http://www.appcoda.com/uipageviewcontroller-storyboard-tutorial/
制作了与UIPageViewController相关的应用程序当UI到达最后一页时,如何更改UIButton的标题,而UIButton位于包含UIPageViewController的UIViewController中?
由于
答案 0 :(得分:0)
阅读完本教程后,您需要做什么:
@property NSString *buttonText;
if (self.buttonText != nil) { [self.button setTitle:self.buttonText forState:UIControlStateNormal]; }
为此,在设置页面索引之后,您可以执行以下操作:
// other initialization pageContentViewController.pageIndex = index; if (index == [self.pageTitles count] - 1) { pageContentViewController.buttonText = @"Your special text"; }
因为按钮的自然文本只有在设置时才会被覆盖,所以只有当用户在最后一页时才应该更改文本!