动画层在NSTableView的未来位置做一些黑暗

时间:2011-12-08 19:18:49

标签: iphone objective-c cocoa

我为nsviewcontroller做动画:

   CABasicAnimation *controlPosAnim = [CABasicAnimation animationWithKeyPath:@"position"];
    controlPosAnim.delegate = self;
    controlPosAnim.duration = 0.5;
    NSRect viewRect =  [getExternalInfoView.view frame];

    NSPoint startingPoint = viewRect.origin;
    NSPoint endingPoint = startingPoint;
    endingPoint.x += getExternalInfoView.view.frame.size.width + 20;
    controlPosAnim.fromValue = [NSValue valueWithPoint:startingPoint];
    controlPosAnim.toValue = [NSValue valueWithPoint:endingPoint];
    [[getExternalInfoView.view layer] addAnimation:controlPosAnim forKey:@"controlViewPosition"];
    getExternalInfoView.view.frame = NSMakeRect(getExternalInfoView.view.frame.origin.x + getExternalInfoView.view.frame.size.width + 20, getExternalInfoView.view.frame.origin.y, getExternalInfoView.view.frame.size.width, getExternalInfoView.view.frame.size.height);

但是我有一点“bug” - 在nstableview的应用程序的未来位置中使黑暗矩形,如“准备未来的视图”(从右向左移动): enter image description here

0 个答案:

没有答案