我有一个问题,我在下面描述了它.
我正在使用UIViewControllerContextTransitioning进行自定义转换.
我有2个视图控制器,第一个视图控制器和第二个视图控制器.
现在我想在带有动画的第一个视图控制器上添加第二视图控制器.我已经实现了,现在我有第二视图控制器透明,所以我们可以看到第二视图控制器下面的第一个视图控制器.
但我无法看到第一个视图控制器,我只能看到第二视图控制器下方的黑屏.
这是代码.
-(void)animateTransition:(id<UIViewControllerContextTransitioning>)transitionContext{
self.transitionContext = transitionContext;
if(self.isPresenting){
[self executePresentationAnimation:transitionContext];
}
else{
[self executeDismissalAnimation:transitionContext];
}
}
-(void)executePresentationAnimation:(id<UIViewControllerContextTransitioning>)transitionContext{
UIView* inView = [transitionContext containerView];
UIViewController* toViewController = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
UIViewController* fromViewController = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
CGRect offScreenFrame = inView.frame;
offScreenFrame.origin.y = inView.frame.size.height;
toViewController.view.frame = offScreenFrame;
toViewController.view.backgroundColor = [UIColor clearColor];
fromViewController.view.backgroundColor = [UIColor clearColor];
inView.backgroundColor = [UIColor clearColor];
[inView insertSubview:toViewController.view aboveSubview:fromViewController.view];
// [inView addSubview:toViewController.view];
CFTimeInterval duration = self.presentationDuration;
CFTimeInterval halfDuration = duration/2;
CATransform3D t1 = [self firstTransform];
CATransform3D t2 = [self …Run Code Online (Sandbox Code Playgroud) 您好,我在我的应用中使用Dropbox API.我想从我的Dropbox帐户下载图像并将它们存储在模拟器或设备目录中.我使用Full DropBox Access在Dropbox中创建了应用程序.但它给了我这个错误:
[警告] DropboxSDK:向/ 1/files/sandbox/Photos发出错误请求 - App文件夹(沙盒)访问尝试失败,因为此应用程序未配置为具有应用程序文件夹.您的访问类型应该是"dropbox"吗?
这是我的代码
restClient = [[DBRestClient alloc] initWithSession:[DBSession sharedSession]];
restClient.delegate = self;
NSString *fileName = [NSString stringWithFormat:@"/avatar.jpg"];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString* path2 = [documentsDirectory stringByAppendingString:
[NSString stringWithFormat:@"%@", fileName]];
[restClient loadFile:fileName intoPath:path2];
Run Code Online (Sandbox Code Playgroud)