标签: uinavigationcontroller

在UINavigationController上的Landscape中加载UIDatePicker

我有一个支持自动旋转的自定义UINavigationController.我的一个视图上还有一个UIDatePicker,我将其扔到Navigation控制器的堆栈上.如果我以纵向方式启动日期选择器视图然后旋转它,则自动旋转有效.如果我尝试在横向开始加载日期选择器视图,则视图全部搞砸了.看起来如果它不支持旋转,框架只有大约一半的选择器可见并偏离中心.

我已经尝试制作我自己的日期选择器,支持自动旋转以防出现问题,我尝试创建两个不同的视图并交换它们,我尝试在ViewWillAppear方法上更改视图框架大小.到目前为止,他们似乎都没有为我工作.

任何人都有任何建议如何让日期选择器在导航控制器上正确显示?我可能忽略了一些简单的事情,答案就在我面前,但我找不到它.

uidatepicker uinavigationcontroller

9
推荐指数
2
解决办法
4351
查看次数

创建一个导航按钮,如iPod"正在播放"按钮

在iPod应用程序中,有一个向右的导航按钮以及通常的左向"后退"按钮.它会让您回到"正在播放"屏幕.这是一个自定义按钮,还是有办法使用标准工具轻松创建一个?

替代文字http://img.skitch.com/20100513-m9b9g67ftfh8bisgbj3mib9sex.jpg

iphone cocoa-touch objective-c uinavigationcontroller

9
推荐指数
1
解决办法
2260
查看次数

何时/为何/如何使用UINavigationControllerDelegate协议实例方法?

何时/为何/如何使用这些方法?

- navigationController:willShowViewController:animated:
– navigationController:didShowViewController:animated:
Run Code Online (Sandbox Code Playgroud)

你不能只使用这些UIViewController实例方法吗?

– viewWillAppear:
– viewDidAppear:
– viewWillDisappear:
– viewDidDisappear:
Run Code Online (Sandbox Code Playgroud)

iphone uiviewcontroller uinavigationcontroller

9
推荐指数
1
解决办法
6376
查看次数

如何推送视图,返回并返回视图?

我想构建一个用于在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

9
推荐指数
1
解决办法
6905
查看次数

调用"pushViewController"时收到"无法加载源:6"控制台消息??? (附代码)

任何想法,为什么我会在调用"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)

iphone uinavigationcontroller ios ekevent ekeventkit

9
推荐指数
1
解决办法
623
查看次数

在iPhone Navigation push中获取Parent View控制器的类名

我正在推这样的观点.

[[self.navigationController pushViewController:myViewController animated:YES];

如何从推送视图(子视图)获取父视图控制器的类名? Any Idea?

iphone push uinavigationcontroller ios

9
推荐指数
1
解决办法
6850
查看次数

根据选择的选项卡更改导航栏的标题?

我有一个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标题?

title uitabbarcontroller uinavigationcontroller ios

9
推荐指数
1
解决办法
6253
查看次数

ios7新的平移手势回到导航堆栈中并不清楚tableview选择

我有一个类似Notes的应用程序:uitableviewcontroller通过将它们推送到导航堆栈来显示单个注释.我决定使用ios7后退按钮和随附的平移手势识别器.

我唯一的修改是通过在推送详细视图控制器之前将from-controller的navigationItem标题设置为空字符串来从按钮中删除文本,因为建议在/sf/ask/1320908991/ 7 -导航栏-自定义后退按钮,没有标题

按钮本身工作正常,但当我通过平移手势从笔记返回到笔记表视图时,不会清理tableview选项!我刚刚过渡的音符行仍然显示为选定的一行.任何想法在这里可能是错的?

我已经检查了标准的Notes应用程序,它就像一个魅力.

back uitableview gesture uinavigationcontroller ios7

9
推荐指数
1
解决办法
1588
查看次数

iOS 8:以纵向呈现模态视图控制器会导致底层风景导航控制器的导航栏调整大小

在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

9
推荐指数
1
解决办法
1667
查看次数

NavigationItem中的UISearchController iOS 11 Apple方式

在iOS 11中,Apple提供了新的搜索栏,但是在iOS 11.2.2开发人员中,当两个视图控制器都有searchController时,它们会推送\ pop动画错误.Apple在Files app中展示了他们的愿景.有人知道怎么做吗?

演示

编辑#1

动画破碎的问题. 破碎的UIearchBar动画嵌入在NavigationItem中

search uinavigationcontroller swift uisearchcontroller ios11

9
推荐指数
1
解决办法
510
查看次数