可能重复:
像iPhone上的Facebook应用程序一样
另一个突破.net开发人员现在试图习惯IOS的世界.
我喜欢新的Facebook iPhone应用程序的布局(2011年10月),并希望在我正在做的应用程序中实现类似的东西.我知道UISplitterControl在iPhone上不可用,但Facebook似乎已经有点神奇,让它在新的应用程序中显示出来.
在Facebook的实现中,它看起来他们使用了一个UINavigationController,当点击NavigationBar图标时,它会向右滑动x,从而用菜单项公开下面的视图.
如果有人可以帮助我解决这个问题,我将不胜感激,因为解决方案也是一个很好的学习曲线.
我已经尝试将UINavigationController设置为AppDelegate窗口根视图控制器,然后使用initwithframe加载自定义视图,其中包含菜单项作为隐藏在UINavigationcontroller根视图后面的子视图.然后当单击UINavgationController菜单项按钮时,将NavigationController向右滑动,从而使下面的视图显示菜单项.这提出了两个问题,首先是子视图定位不起作用,以及如何将实际的UINavigationController向右滑动公开下面的菜单视图.
请帮忙!
iphone facebook uinavigationcontroller uisplitviewcontroller ios
从Home视图 - 我的RootViewController - 当用户在导航层次结构中进行时,我一个接一个地打开2个ViewControllers,如下所示:
1)通过我的Storyboard中连接的按钮推送SecondViewController
2)ThirdViewController以模态呈现
[self performSegueWithIdentifier:@"NextViewController" sender:nil];
Run Code Online (Sandbox Code Playgroud)
所以,图片是:RootViewController - > SecondViewController - > ThirdViewController
现在在我的ThirdViewController中,我希望有一个按钮可以返回2次到我的RootViewController,即回家.但这不起作用:
[self.navigationController popToRootViewControllerAnimated:YES];
Run Code Online (Sandbox Code Playgroud)
只有这个人回到SecondViewController一次
[self.navigationController popViewControllerAnimated:YES];
Run Code Online (Sandbox Code Playgroud)
如何同时删除模态和推送视图控制器?
objective-c storyboard uiviewcontroller uinavigationcontroller ios
将新控制器添加到导航堆栈时:
self.navigationController!.pushViewController(PushedViewController(), animated: true)
Run Code Online (Sandbox Code Playgroud)
从右边看:
如何更改动画的方向以使其从左侧显示?
可能重复:
如何在iphone导航栏上添加背景图片?
我正在寻找一种方法来拥有一个自定义导航栏,并需要有一个自定义导航栏背景来实现这一目标.我正在四处寻找如何做到这一点,但无法找到解决方案.如果有人有解决方案,非常感谢帮助.
我在导航栏上有一个UIBarButtonItem.我想把它做成箭头形状.我的意思是我希望它是正方形,除了尖尖的一面.有谁知道如何做到这一点?
谢谢!
我有一个应用程序,它有一个名为store的视图.在此视图中,有一个加载DetailView的按钮.问题是此详细视图无法加载/显示.这是我使用的代码:
-(void)knop:(id)sender{
categoryView = [[CategoryView alloc] init];
//show detail view using buttonDetail...
[self.navigationController pushViewController:categoryView animated:YES];
[categoryView release];
NSLog(@"Button is working");
}
Run Code Online (Sandbox Code Playgroud)
日志"按钮正在工作"日志,因此也会触发pushViewController行.
categoryView是在我的.h文件中制作的:
CategoryView IBOutlet *categoryView;
}
@property (nonatomic, retain) IBOutlet CategoryView *categoryView;
Run Code Online (Sandbox Code Playgroud)
在store.xib中有一个UIViewController,其出口链接到categoryView出口.
在我的应用程序的其他地方这是有效的,我似乎无法找出为什么这个不是
任何帮助,将不胜感激!日Thnx
iphone objective-c uinavigationcontroller pushviewcontroller ios
我有价值NSUserdefaults.我正在使用storyboard,它嵌入在UINavigationController.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
if([[NSUserDefaults standardUserDefaults]objectForKey:@"isLoggedIn"]){
//show home page here
}else{
// show login view
}
}
Run Code Online (Sandbox Code Playgroud)
我可以使用打开应用程序URL还
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
NSString *text = [[url host] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
if(text.length > 0){
// show home page
}else {
// show settings page
}
return YES;
}
Run Code Online (Sandbox Code Playgroud)
如何根据检索到的值设置rootViewControllerfor UINavigationController.任何人都可以帮帮我吗?
objective-c storyboard nsuserdefaults uinavigationcontroller appdelegate
当我设置navigationController.hidesBarOnSwipe = YES并尝试在显示的webView中滑动时,导航栏被隐藏,但当我尝试滑动以将其取回时,它将永远不会再出现.
我的ViewController正在监听滑动事件:
[self.navigationController.barHideOnSwipeGestureRecognizer addTarget:self action:@selector(swipe:)]?
Run Code Online (Sandbox Code Playgroud)
但是,由于滑动隐藏了导航栏,因此实际上从未再次调用此选择器.谁实施了hidesBarOnSwipe?它是一个已知的错误还是它的设计,它隐藏后不会显示导航栏.
之前:

后:

有没有办法只使用导航控制器更改应用程序中的左侧后退按钮颜色?
在导航栏中有很多改变颜色的例子,但这些都会影响导航栏标题.我不想改变标题.只需后退按钮(文字+雪佛龙)颜色.
我昨天将我的设备更新到iOS 11 Beta,我的应用程序在AppDelegate中使用此代码在所有屏幕上隐藏了后退按钮标题:
@implementation UINavigationItem (Customization)
/**
Removes text from all default back buttons so only the arrow or custom image shows up.
*/
-(UIBarButtonItem *)backBarButtonItem
{
return [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:nil];
}
Run Code Online (Sandbox Code Playgroud)
它在旧版本上正常工作,但是当我在iOS 11 Beta上运行我的应用程序时,后退按钮的标题仍然显示.有人面对这个问题吗?它是iOS或iOS 11的测试版bug需要另一种隐藏后退按钮标题的方法吗?
ios ×6
iphone ×4
objective-c ×3
storyboard ×2
swift ×2
animation ×1
appdelegate ×1
facebook ×1
ios11 ×1
navigation ×1
sdk ×1
xcode ×1