在这个(Flip View Iphone)帖子中,我为我的iPhone应用程序创建了一个翻转视图.现在,我想确保每当用户点击导航栏中的"后退"按钮时,下次当他向下钻到可翻转视图时,此视图处于其原始的非翻转位置.目前,应用程序实际上加载了正确的视图,但不知何故,当您尝试将其翻转时,它不能加载翻转视图,并且仅呈现黑色背景.一种解决方案可能是将翻转方法("showLessInfo")分配给导航按钮,这就是我需要你的帮助.或者,对我来说很可能更好的想法是理解为什么第二次没有加载翻转视图.欢迎任何建议!
我想在TTNavigator提供的TTViewController中隐藏UINavigationBar.
有没有办法存档?
我正在使用iOS 5 UINavigationBar的UIAppearance协议来自定义我的所有导航栏.
这是我的自定义功能:
- (void)customizeApperance
{
[[UINavigationBar appearance] setTintColor:[UIColor clearColor]];
[[UINavigationBar appearance] setAlpha:0.7];
UIImageView *titleView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"title.png"]];
[[UINavigationBar appearance] setTitleView:titleView];
}
Run Code Online (Sandbox Code Playgroud)
我有两个问题:
首先是颜色不是clearColor黑色.有什么建议?
标题视图根本没有出现.Ray Wenderlich通过添加:[[rootViewController navigationItem] setTitleView: [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"miniLogo.png"]]]in 来演示如何做到这一点applicationDidFinishLaunching.但问题是标题视图只会添加到根视图控制器中.我正在使用一个UINavigationController当我厌倦了替换rootViewControllerwith navigationController(我在AppDelegate中的导航控制器的名称)时,我根本看不到标题视图.我该如何解决这个问题?为什么不工作customizeApperance()?使用外观的关键不仅仅是创建一次标题视图(就像我在函数上面所做的那样)并且在所有导航栏中都是全局的吗?我怎样才能做到这一点?
iphone objective-c uinavigationbar uinavigationcontroller uiappearance
我正在寻找一种方法让导航栏根本不显示在屏幕上.
我知道setNavigationBarHidden:animated:在导航栏上可以使用,但是在删除和重新调整屏幕尺寸之前,这仍然会在屏幕上显示一秒钟.
我试着移动setNavigationBarHidden:animated:到viewDidLoad:,viewWillAppear:等,并把它隐藏在以前的活动viewWillDisappear:,但它会显示出下一个屏幕上.
如何在视图显示之前将视图加载到导航栏上?
谢谢,德曼
iPhone的默认日历程序在导航栏中同时显示"<"和文本.
我想同时拥有图像和文本.
这是如何在Xcode中实现的?

我想UINavigationBar在我的根视图中添加一个并在导航栏上设置标题.我尝试过使用其他类似问题的很多答案,但都没有奏效.
我正在以编程方式创建整个视图层次结构(因为我正在使用theos).在UINavagationBar启动应用程序时是可见的,但它没有标题,即使我都设置根视图控制器的标题和导航栏的标题顶部的项目.
我的应用程序只有一个主视图,因此导航栏仅出于美观原因.
该应用程序的完整源代码位于该行下方.
main.m文件:
int main(int argc, char **argv) {
@autoreleasepool {
return UIApplicationMain(argc, argv, @"CapabilitiesEditorApplication", @"CapabilitiesEditorApplication");
}
}
Run Code Online (Sandbox Code Playgroud)
CapabilitiesEditorApplication.m:
#import "RootViewController.h"
@interface CapabilitiesEditorApplication: UIApplication <UIApplicationDelegate> {
UIWindow *_window;
RootViewController *_viewController;
}
@property (nonatomic, retain) UIWindow *window;
@end
@implementation CapabilitiesEditorApplication
@synthesize window = _window;
- (void)applicationDidFinishLaunching:(UIApplication *)application {
_window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
_viewController = [[RootViewController alloc] init];
[_window addSubview:_viewController.view];
[_window makeKeyAndVisible];
}
@end
Run Code Online (Sandbox Code Playgroud)
RootViewController.h:
@interface RootViewController: UIViewController
@property UINavigationBar *navigationBar;
@end
Run Code Online (Sandbox Code Playgroud)
RootViewController.m: …
我曾经使用下面的代码更改我的应用程序的标题属性(font,textColor等)或Nativgation Bar:
[[UINavigationBar appearance] setTitleTextAttributes:
[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor], UITextAttributeTextColor, nil]];`
Run Code Online (Sandbox Code Playgroud)
今天我注意到在iOS8 GM Seed上,textColor没有变化,仍然是黑色.
如果有人遇到过类似的问题并得到解决,那么非常感谢.
我正在尝试调整我的iphone 6应用程序.
在将自定义背景图像设置到导航栏之前,一切运行良好:
[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"navbarbg.png"] forBarMetrics:UIBarMetricsDefault];
Run Code Online (Sandbox Code Playgroud)
由于此图像是为iphone 4/5制作的,因此宽度不足.
你知道如何为iphone6设置正确的图像吗?
我试图将我的图像命名为navbarbg@3x.png或navabarbg-667h@3x.png,但它不会改变任何内容.
任何的想法 ?
更新:我添加了我使用的图像:

如何在Swift中更改大标题导航栏的字体?
我无法找到涵盖实现带有大标题的导航栏的自定义字体的线程。
我正在尝试使用标题为“ ??????????? W8.ttc”的字体。这似乎已预装在我的Mac上。字体书中的名称是:“ Hiragino Kaku Gothic StdN”。
这是我尝试过的:
self.navigationController?.navigationBar.largeTitleTextAttributes = [NSAttributedString.Key.font: UIFont(name: "???????????-W8", size: 20)!]
Run Code Online (Sandbox Code Playgroud)
和
self.navigationController?.navigationBar.largeTitleTextAttributes = [NSAttributedString.Key.font: UIFont(name: "???????????W8", size: 20)!]
Run Code Online (Sandbox Code Playgroud)
和
self.navigationController?.navigationBar.largeTitleTextAttributes = [NSAttributedString.Key.font: UIFont(name: "Hiragino Kaku Gothic StdN", size: 20)!]
Run Code Online (Sandbox Code Playgroud)
字体文件名使用其他语言还是其他问题?
uinavigationbar ×10
ios ×6
iphone ×5
objective-c ×2
cocoa-touch ×1
flip ×1
hide ×1
ios8 ×1
swift ×1
three20 ×1
ttnavigator ×1
uiappearance ×1
uiimageview ×1
view ×1
xcode ×1