在结束这个问题之前,我只是看到过去两天我面临一个严重的问题.
我正在关注UIPageViewController与故事板教程.
我试着开发我的UIPageviewController.我要展示一些用户照片.我不想在底部显示apagecontrol,所以我创建了一个自定义页面控件.当我尝试将索引设置为UIPageControl时,它无法正常工作 - 有些延迟有时会达到第5页而只是更新,因此计数不正确
这是我的数据源:
-(UIViewController*)pageViewController:(UIPageViewController *)pageViewController viewControllerBeforeViewController:(UIViewController *)viewController
{
NSUInteger index = ((BMEnlargePhotoPageView*) viewController).pageIndex;
[self.enlargePhotoPageControl setCurrentPage:index];
if((index == 0 ) || (index==NSNotFound)){
return nil;
}
index--;
return [self viewControllerATindex:index];
}
-(UIViewController*)pageViewController:(UIPageViewController *)pageViewController viewControllerAfterViewController:(UIViewController *)viewController
{
NSUInteger index = ((BMEnlargePhotoPageView*) viewController).pageIndex;
[self.enlargePhotoPageControl setCurrentPage:index];
if(index==NSNotFound){
return nil;
}
index++;
if(index==[self.userImages count])
{
return nil;
}
return [self viewControllerATindex:index];
}
- (BMEnlargePhotoPageView*)viewControllerATindex:(NSUInteger)index
{
if(([self.userImages count]==0) || (index >= [self.userImages count])){
}
BMEnlargePhotoPageView *PageContentViewControl = [self.storyboard instantiateViewControllerWithIdentifier:@"EnlargePhoto"];
PageContentViewControl.imageFIle =self.userImages[index];
PageContentViewControl.pageIndex …Run Code Online (Sandbox Code Playgroud) 实际上我正在进行可操作的通知.一切正常我正在获得按钮触发动作,但问题是当我点击按钮时应用程序没有打开.当我手动打开应用程序时触发相应的操作并转到确切的屏幕,但是当我点击按钮时它不会发生.
这是我可操作通知的设置
NSString * const NotificationCategoryIdent = @"ACTIONABLE";
NSString * const NotificationActionOneIdent = @"ACTION_ONE";
NSString * const NotificationActionTwoIdent = @"ACTION_TWO";
-(UIMutableUserNotificationCategory*)registerActions {
UIMutableUserNotificationAction *action1;
action1 = [[UIMutableUserNotificationAction alloc] init];
[action1 setActivationMode:UIUserNotificationActivationModeBackground];
[action1 setTitle:@"Open"];
[action1 setIdentifier:NotificationActionOneIdent];
[action1 setDestructive:NO];
[action1 setAuthenticationRequired:NO];
UIMutableUserNotificationAction *action2;
action2 = [[UIMutableUserNotificationAction alloc] init];
[action2 setActivationMode:UIUserNotificationActivationModeBackground];
[action2 setTitle:@"Delete"];
[action2 setIdentifier:NotificationActionTwoIdent];
[action2 setDestructive:NO];
[action2 setAuthenticationRequired:NO];
UIMutableUserNotificationCategory *actionCategory;
actionCategory = [[UIMutableUserNotificationCategory alloc] init];
[actionCategory setIdentifier:NotificationCategoryIdent];
[actionCategory setActions:@[action1, action2]
forContext:UIUserNotificationActionContextDefault];
NSSet *categories = [NSSet setWithObject:actionCategory];
UIUserNotificationType types = (UIUserNotificationTypeAlert|
UIUserNotificationTypeSound|
UIUserNotificationTypeBadge); …Run Code Online (Sandbox Code Playgroud) 我正在围绕iOS中的airplay进行工作,我能够做到这一点而没有任何问题。我的问题是打开镜像时可以在Apple TV上看到我的手机屏幕,但是我想以编程方式关闭镜像并必须显示Apple TV默认播放器,这是可能的,因为我看到了Netflix App,他们正在这样做。
那么任何人都可以帮忙吗?