新的Facebook应用程序似乎已经废除了网格图标布局,有一个更有趣的自定义导航布局,其中最底部的视图显示所有选项(如个人资料,新闻源,Facebook的消息等)并点击其中一个它们带来了另一种俯瞰顶部的视图.您可以按3行按钮然后再次显示底部视图,但当前视图部分可见.Path应用程序最近也更新以匹配此方案.
重建这个的最佳方法是什么?我搜索过任何开源选项,但还没有找到它们.Three20似乎也不支持这一点.
最近我更新了我的xcode项目以使用iOS 7,但我遇到了一个大问题.因为我的整个应用程序只有一个背景图像(UIImageView添加到关键窗口)并且所有视图都是透明的,所以我在推UIViewController时遇到问题,因为推送的视图控制器与之前的视图重叠(你可以在这里看到它:http:/ /grab.by/qp0k).我可以预测这是因为在iOS 7中推送转换已经改变,因为现在它滑动了半个屏幕.也许有人知道如何解决这个问题?
这就是我设置关键窗口的方法
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
UIImageView *background = [[UIImageView alloc]initWithFrame:[[UIScreen mainScreen] bounds]];
background.image = [UIImage imageNamed:@"background.png"];
UINavigationController *navi = [[UINavigationController alloc]initWithRootViewController:self.viewController];
self.window.rootViewContro??ller = navi;
[self.window makeKeyAndVisible];
Run Code Online (Sandbox Code Playgroud)
之后当用户点击"开始锻炼"按钮时,我会一如既往地推送我的下一个视图:
workoutView *w = [[workoutView alloc]initWithNibName:@"workoutView" bundle:nil];
[self.navigationController pushViewController:w animated:YES];
Run Code Online (Sandbox Code Playgroud) 一个的UITabBarController的默认行为是弹出所包含的UINavigationController到根视图控制器当特定标签被点击第二次.我有一个特殊的用例,我希望它不能自动工作,而我很难弄清楚如何防止这种情况.
有没有人碰到这个,如果有的话,你做了什么?我是否需要子类化UINavigationController并覆盖popToRootViewController或者是否有更简单的方法?
我有一个UINavigationController.我正在尝试在navigationBar的右侧添加多个按钮.我怎样才能做到这一点?需要什么样的按钮?UIBarButton还是UINavigationItem?
我将一个模态视图控制器呈现为一个表单,并在单击取消按钮(即一个条形按钮项目)时将其解除.当我在该视图之外点击时,我需要忽略它.请帮我一个参考.注意:我的模态视图控制器带有导航控制器.
@cli_hlt,@ Bill Brasky感谢您的回答.当在作为表单的模态视图之外发生敲击时,我需要忽略它.我在下面粘贴我的代码.
-(void)gridView:(AQGridView *)gridView didSelectItemAtIndex:(NSUInteger)index
{
if(adminMode)
{
CHEditEmployeeViewController *editVC = [[CHEditEmployeeViewController alloc] initWithNibName:@"CHEditEmployeeViewController" bundle:nil];
editVC.delegate = self;
editVC.pickedEmployee = employee;
editVC.edit = TRUE;
editVC.delegate = self;
UINavigationController *navigationController = [[UINavigationController alloc]initWithRootViewController:editVC];
navigationController.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentModalViewController:navigationController animated:YES];
return;
} //the above code is from the view controller which presents the modal view. Please look at the below code too which is from my modal view controller. Please guide me in a proper way. -(void)tapGestureRecognizer {
UITapGestureRecognizer *recognizer …Run Code Online (Sandbox Code Playgroud) xcode objective-c uinavigationcontroller modalviewcontroller
我有一个UIViewController中包含的UIWebView,它是UINavigationController的后代.它看起来像这样:

该应用程序仅限肖像.当我播放视频时,我希望用户能够旋转设备并以横向模式观看视频.我使用这段代码来允许它:
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
id presentedViewController = [self topMostController];
NSString *className = presentedViewController ? NSStringFromClass([presentedViewController class]) : nil;
if ([className isEqualToString:@"MPInlineVideoFullscreenViewController"] ||
[className isEqualToString:@"MPMoviePlayerViewController"] ||
[className isEqualToString:@"AVFullScreenViewController"]) {
return UIInterfaceOrientationMaskAllButUpsideDown;
}
return UIInterfaceOrientationMaskPortrait;
}
- (UIViewController *)topMostController {
UIViewController *topController = [UIApplication sharedApplication].keyWindow.rootViewController;
while (topController.presentedViewController) {
topController = topController.presentedViewController;
}
return topController;
}
Run Code Online (Sandbox Code Playgroud)
然后在我的UINavigationController中(所以当视频完成后,视图不会以横向呈现,只能以纵向呈现):
- (BOOL)shouldAutorotate
{
return NO;
}
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationPortrait;
}
Run Code Online (Sandbox Code Playgroud)
一切都很完美:

但是视频完成播放(或者用户点击'完成')并且屏幕返回到底层视图,这是发生的事情:

如您所见,导航栏在状态栏下滑动.另外,我在日志中遇到了很多自动布局错误:http …
objective-c uiwebview uinavigationcontroller screen-rotation ios
我正在使用故事板,当我按下某个按钮(或调用功能)时,我试图隐藏主导航控制器的顶部栏.我知道我必须从故事板(使用标识符)初始化一个引用导航控制器的对象,但是当我将setNavigationBarHidden消息发送到这个新创建的对象时,屏幕上并没有真正发生.
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
UINavigationController *navController = (UINavigationController*) [storyboard instantiateViewControllerWithIdentifier:@"MyNavController"];
[navController setNavigationBarHidden:YES animated:YES];
Run Code Online (Sandbox Code Playgroud)
有谁知道问题是什么?
我正在抓住Dribble并找到了附件设计.我想知道如何做这样的自定义导航栏.我的意思是如何创建一次导航栏并为每个视图控制器隐式重用它.
我正在考虑使用一种根视图控制器并继承其他视图控制器,但我不知道如何做到这一点.
任何想法或链接将是appreachated!
干杯.
西里尔

iphone user-interface uinavigationcontroller navigationcontroller ios
如何像iPhone中的预告片应用程序一样实现导航栏的实时模糊效果.
即当您滚动时,内容应该在导航栏后面变得模糊.请帮我一些代码.
谢谢!
我想达到这样的效果: -

objective-c uinavigationbar uinavigationcontroller ios swift
我实现了一个带有UITableView的基本UIViewController,它包含在UINavigationController中.我设置prefersLargeTitles为true:
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
navigationController?.navigationBar.prefersLargeTitles = true
navigationItem.title = "Coffees"
}
Run Code Online (Sandbox Code Playgroud)
但是,标题保持很小,直到我滚动视图,此时它会放大.我尝试将该调用移动到我创建UINavigationController的位置,但没有效果.我确定我设置时navigationController不是nil prefersLargeTitles.
我应该在其他地方更新该房产吗?或者我应该提交雷达?
更新:
如果我的视图包含一个UITableView或本身就是一个,这似乎只会发生UITableViewController
ios ×6
iphone ×4
objective-c ×4
swift ×2
xcode ×2
cocoa-touch ×1
facebook ×1
ios7 ×1
storyboard ×1
uikit ×1
uiwebview ×1
xcode5 ×1