我有一个支持自动旋转的自定义UINavigationController.我的一个视图上还有一个UIDatePicker,我将其扔到Navigation控制器的堆栈上.如果我以纵向方式启动日期选择器视图然后旋转它,则自动旋转有效.如果我尝试在横向开始加载日期选择器视图,则视图全部搞砸了.看起来如果它不支持旋转,框架只有大约一半的选择器可见并偏离中心.
我已经尝试制作我自己的日期选择器,支持自动旋转以防出现问题,我尝试创建两个不同的视图并交换它们,我尝试在ViewWillAppear方法上更改视图框架大小.到目前为止,他们似乎都没有为我工作.
任何人都有任何建议如何让日期选择器在导航控制器上正确显示?我可能忽略了一些简单的事情,答案就在我面前,但我找不到它.
在iPod应用程序中,有一个向右的导航按钮以及通常的左向"后退"按钮.它会让您回到"正在播放"屏幕.这是一个自定义按钮,还是有办法使用标准工具轻松创建一个?
替代文字http://img.skitch.com/20100513-m9b9g67ftfh8bisgbj3mib9sex.jpg
何时/为何/如何使用这些方法?
- navigationController:willShowViewController:animated:
– navigationController:didShowViewController:animated:
Run Code Online (Sandbox Code Playgroud)
你不能只使用这些UIViewController实例方法吗?
– viewWillAppear:
– viewDidAppear:
– viewWillDisappear:
– viewDidDisappear:
Run Code Online (Sandbox Code Playgroud) 我想构建一个用于在iPhone上播放本地音频文件的应用程序但我仍然坚持使用我的一些代码.我想知道如何推送视图,回到uitableviewcontroller并使用一个按钮(如媒体播放器中的"NOW PLAYING"按钮)返回视图,而不会将任何新字符串推入其中.
谢谢
我应该从我的代码中更改什么?
在uitableviewcontroller ..
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
*)indexPath {
selectedSong = [directoryContent objectAtIndex:indexPath.row];
NSString *storyLin = [[directoryContent objectAtIndex:[indexPath row]] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
patch = [NSString stringWithFormat:@"/%@", storyLin];
myDetViewCont = [[mPlayerViewController alloc] initWithNibName:@"mPlayerViewController" bundle:nil];
myDetViewCont.myProgLang = selectedSong; // assigning the correct value to the variable inside DetailViewController
[self.navigationController pushViewController:myDetViewCont animated:YES];
[myDetViewCont release]; // releasing controller from the memory
}
Run Code Online (Sandbox Code Playgroud)
在mPlayerViewController.m中
-(IBAction) backtoplayer{
myDetViewCont = [[mPlayerViewController alloc] initWithNibName:@"mPlayerViewController" bundle:nil];
}
Run Code Online (Sandbox Code Playgroud) iphone xcode uitableview uinavigationcontroller pushviewcontroller
任何想法,为什么我会在调用"pushViewController"时看到"无法加载源:6"控制台消息?新观点似乎没问题.代码是:
代码除外:
EKEventViewController *eventViewController = [[EKEventViewController alloc] init];
eventViewController.event = event;
eventViewController.allowsEditing = YES;
eventViewController.delegate = self;
[self.navigationController pushViewController:eventViewController animated:YES]; // <== OCCURS HERE
Run Code Online (Sandbox Code Playgroud) 我正在推这样的观点.
[[self.navigationController pushViewController:myViewController animated:YES];
如何从推送视图(子视图)获取父视图控制器的类名? Any Idea?
我有一个iOS应用程序,其中有一个导航控制器作为根控制器,但在一个部分有一个标签栏,可以在其中一个导航栏中选择视图.它看起来类似于iTunes应用程序(顶部的导航栏,底部的标签栏).我希望导航栏的标题根据选择的选项卡进行更改.我为每个选项卡分别有两个控制器文件.这是我到目前为止尝试使用的内容,以解决这个问题无济于事:
self.navigationItem.title = @"Title";
self.navigationController.navigationItem.title = @"title";
[self.navigationController setTitle:@"Live"];
[self setTitle:@"Top Title"];
Run Code Online (Sandbox Code Playgroud)
如何根据按下哪个选项卡更改NavBar标题?
我有一个类似Notes的应用程序:uitableviewcontroller通过将它们推送到导航堆栈来显示单个注释.我决定使用ios7后退按钮和随附的平移手势识别器.
我唯一的修改是通过在推送详细视图控制器之前将from-controller的navigationItem标题设置为空字符串来从按钮中删除文本,因为建议在/sf/ask/1320908991/ 7 -导航栏-自定义后退按钮,没有标题
按钮本身工作正常,但当我通过平移手势从笔记返回到笔记表视图时,不会清理tableview选项!我刚刚过渡的音符行仍然显示为选定的一行.任何想法在这里可能是错的?
我已经检查了标准的Notes应用程序,它就像一个魅力.
在iOS 8上,我对导航栏和方向更改有一个奇怪的行为.
我有一个导航控制器,报告支持的界面方向UIInterfaceOrientationMaskLandscapeRight.导航栏具有预期的横向高度(遗憾的是我无权发布屏幕截图).
然后我启动一个仅支持的视图控制器的模态演示UIInterfaceOrientationMaskPortrait.当演示动画开始时,似乎底层导航控制器的度量被改变为纵向呈现,因为导航栏的高度增长到其肖像大小,如上所述.
iOS 7不会出现此行为.我错过了什么?我想恢复旧的行为.
以下是上述简单示例的完整代码:
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
DOGButtonViewController *root = [DOGButtonViewController new];
DOGOrientedNavigationController *navi = [[DOGOrientedNavigationController alloc] initWithRootViewController:root];
navi.allowedInterfaceOrientations = UIInterfaceOrientationMaskLandscapeRight;
self.window.rootViewController = navi;
[self.window makeKeyAndVisible];
return YES;
}
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
return UIInterfaceOrientationMaskLandscapeRight | UIInterfaceOrientationMaskPortrait;
}
@end
@implementation DOGOrientedNavigationController
- (NSUInteger)supportedInterfaceOrientations
{
return self.allowedInterfaceOrientations;
}
@end
@implementation DOGButtonViewController
- (void)viewDidLoad
{
[super viewDidLoad];
self.title = @"Button View Controller"; …Run Code Online (Sandbox Code Playgroud) uiviewcontroller uinavigationcontroller presentviewcontroller ios8
在iOS 11中,Apple提供了新的搜索栏,但是在iOS 11.2.2开发人员中,当两个视图控制器都有searchController时,它们会推送\ pop动画错误.Apple在Files app中展示了他们的愿景.有人知道怎么做吗?

编辑#1
动画破碎的问题. 破碎的UIearchBar动画嵌入在NavigationItem中
search uinavigationcontroller swift uisearchcontroller ios11
iphone ×5
ios ×3
uitableview ×2
back ×1
cocoa-touch ×1
ekevent ×1
ekeventkit ×1
gesture ×1
ios11 ×1
ios7 ×1
ios8 ×1
objective-c ×1
push ×1
search ×1
swift ×1
title ×1
uidatepicker ×1
xcode ×1