我想创建一个iPhone应用程序,它使用类似于链接中所示的导航场景

请注意我不希望这只适用于iPad,我希望它完全按照图片的方式为iPhone工作,当你点击一个tableview项目时它会隐藏tableview并使该视图全屏显示.我想知道如何做到这一点,因为我无法弄明白自己.
谢谢
iphone objective-c uinavigationcontroller tableview uisplitviewcontroller
我到处都在搜索,到目前为止没有什么对我有用.
基本上我想要一个名为rootView.xib的.xib文件,在其中我希望有一个UIView(让我们称之为containerView)只占用屏幕的一半(因此会有常规视图和新视图).然后我想要一个名为firstView.xib的不同.xib文件并将其加载到containerView中.所以我可以在firstView.xib上有一堆东西和rootView.xib中的一堆不同的东西,并在rootView.xib中加载我的firstView.xib在containerView中,但由于它只占用了屏幕的一半,你仍然可以看到rootView.xib上的东西
我试图实现一个动画,当你按住一个按钮时,它会向下动画一个块,当你释放时,它会将它动画回原来的位置,但无论如何我都无法获得动画块的当前位置.这是我的代码:
-(IBAction)moveDown:(id)sender{
CGRect position = [[container.layer presentationLayer] frame];
[movePath moveToPoint:CGPointMake(container.frame.origin.x, position.y)];
[movePath addLineToPoint:CGPointMake(container.frame.origin.x, 310)];
CAKeyframeAnimation *moveAnim = [CAKeyframeAnimation animationWithKeyPath:@"position"];
moveAnim.path = movePath.CGPath;
moveAnim.removedOnCompletion = NO;
moveAnim.fillMode = kCAFillModeForwards;
CAAnimationGroup *animGroup = [CAAnimationGroup animation];
animGroup.animations = [NSArray arrayWithObjects:moveAnim, nil];
animGroup.duration = 2.0;
animGroup.removedOnCompletion = NO;
animGroup.fillMode = kCAFillModeForwards;
[container.layer addAnimation:animGroup forKey:nil];
}
-(IBAction)moveUp:(id)sender{
CGRect position = [[container.layer presentationLayer] frame];
UIBezierPath *movePath = [UIBezierPath bezierPath];
[movePath moveToPoint:CGPointMake(container.frame.origin.x, position.y)];
[movePath addLineToPoint:CGPointMake(container.frame.origin.x, 115)];
CAKeyframeAnimation *moveAnim = [CAKeyframeAnimation animationWithKeyPath:@"position"];
moveAnim.path = movePath.CGPath;
moveAnim.removedOnCompletion = NO; …Run Code Online (Sandbox Code Playgroud) 如何从反转中删除对象NSArray.
目前我有一个NSMutableArray,然后我反过来
NSArray* reversedCalEvents = [[calEvents reverseObjectEnumerator] allObjects];
Run Code Online (Sandbox Code Playgroud)
现在我需要从项目中删除reversedCalEvents或calEvents自动刷新数组根据条件显示的表.即
if(someInt == someOtherInt){
remove object at index 0
}
Run Code Online (Sandbox Code Playgroud)
我怎样才能做到这一点?我无法让它发挥作用.
以下是我的记录按钮方法的内容.它创建了所需的文件,但无论我记录多长时间,创建的文件总是4kb和0秒,我无法弄清楚它为什么无效.对于averagePowerPerChannel,计量也返回-120,我假设它是因为文件已损坏.
NSDictionary *recordSettings = [NSDictionary
dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:AVAudioQualityMin],
AVEncoderAudioQualityKey,
[NSNumber numberWithInt:16],
AVEncoderBitRateKey,
[NSNumber numberWithInt: 2],
AVNumberOfChannelsKey,
[NSNumber numberWithFloat:44100.0],
AVSampleRateKey,
nil];
NSError *error;
NSArray *dirPaths;
NSString *docsDir;
dirPaths = NSSearchPathForDirectoriesInDomains(
NSDocumentDirectory, NSUserDomainMask, YES);
docsDir = [dirPaths objectAtIndex:0];
NSString *soundFilePath = [docsDir
stringByAppendingPathComponent:@"sound.caf"];
NSURL *soundFileURL = [NSURL fileURLWithPath:soundFilePath];
self.shotRecorder = [[AVAudioRecorder alloc] initWithURL:soundFileURL settings:recordSettings error:&error];
self.shotRecorder.delegate = self;
if (error)
{
NSLog(@"error: %@", [error localizedDescription]);
} else {
[self.shotRecorder prepareToRecord];
self.shotRecorder.meteringEnabled = YES;
[self.shotRecorder record];
shotTimer = [NSTimer scheduledTimerWithTimeInterval: 0.03 target: self …Run Code Online (Sandbox Code Playgroud) ios ×3
objective-c ×3
avfoundation ×1
caanimation ×1
calayer ×1
cgrect ×1
iphone ×1
nsarray ×1
tableview ×1
uitableview ×1
uiview ×1
xib ×1