草庐IT

UINavigationBar

全部标签

ios - 更改后退导航栏按钮的字体

我希望能够设置我的应用导航栏后退按钮的字体,而不会做任何过于疯狂的事情并且不会丢失按钮的任何其他设计特征(即我想保留箭头)。现在我在viewDidAppear:中使用它来设置普通栏按钮项的字体。for(NSObject*viewinself.navigationController.navigationBar.subviews){if([viewisKindOfClass:[UIButtonclass]]){[((UIButton*)view).titleLabelsetFont:[UIFontfontWithName:@"GillSans"size:14.0]];}}但是,无论此代码

ios - 无法在导航栏中心设置titleView,因为返回按钮

我正在使用ImageView在导航栏中显示图像。问题是由于后退按钮,我无法将其正确设置为中心。我查了相关问题,之前解决的问题几乎相同,但这次我不知道。之前我用假条形按钮解决了这个问题,所以我尝试在右侧(和左侧)添加一个假条形按钮,但没有帮助。-(void)searchButtonNavBar{CGRectimageSizeDummy=CGRectMake(0,0,25,25);UIButton*dummy=[[UIButtonalloc]initWithFrame:imageSizeDummy];UIBarButtonItem*searchBarButtonDummy=[[UIBarB

ios - 无法在导航栏中心设置titleView,因为返回按钮

我正在使用ImageView在导航栏中显示图像。问题是由于后退按钮,我无法将其正确设置为中心。我查了相关问题,之前解决的问题几乎相同,但这次我不知道。之前我用假条形按钮解决了这个问题,所以我尝试在右侧(和左侧)添加一个假条形按钮,但没有帮助。-(void)searchButtonNavBar{CGRectimageSizeDummy=CGRectMake(0,0,25,25);UIButton*dummy=[[UIButtonalloc]initWithFrame:imageSizeDummy];UIBarButtonItem*searchBarButtonDummy=[[UIBarB

ios - 嵌入自定义容器 View Controller 时,内容位于导航栏下方。

更新根据Tim的回答,我在每个ViewController中实现了以下内容,该Controller具有作为我的自定义容器一部分的ScrollView(或子类):-(void)didMoveToParentViewController:(UIViewController*)parent{if(parent){CGFloattop=parent.topLayoutGuide.length;CGFloatbottom=parent.bottomLayoutGuide.length;//thisisthemostimportantparthere,becausethefirstviewcont

ios - 嵌入自定义容器 View Controller 时,内容位于导航栏下方。

更新根据Tim的回答,我在每个ViewController中实现了以下内容,该Controller具有作为我的自定义容器一部分的ScrollView(或子类):-(void)didMoveToParentViewController:(UIViewController*)parent{if(parent){CGFloattop=parent.topLayoutGuide.length;CGFloatbottom=parent.bottomLayoutGuide.length;//thisisthemostimportantparthere,becausethefirstviewcont

ios - UITableView 在半透明的导航栏下

我正在尝试在IOS7应用程序中使用透明导航栏。我的应用程序中有一个全屏图像。我在该图像上也有一个UITableView。当我使用下面的代码时,图像适合我想要的屏幕,但UITableView位于导航栏下方。在viewDidLoad我用self.navigationController.navigationBar.shadowImage=[UIImagenew];self.navigationController.navigationBar.translucent=YES;self.navigationController.view.backgroundColor=[UIColorclea

ios - UITableView 在半透明的导航栏下

我正在尝试在IOS7应用程序中使用透明导航栏。我的应用程序中有一个全屏图像。我在该图像上也有一个UITableView。当我使用下面的代码时,图像适合我想要的屏幕,但UITableView位于导航栏下方。在viewDidLoad我用self.navigationController.navigationBar.shadowImage=[UIImagenew];self.navigationController.navigationBar.translucent=YES;self.navigationController.view.backgroundColor=[UIColorclea

objective-c - 以编程方式将按钮添加到导航栏

您好,我需要在右侧的导航栏中以编程方式设置按钮,这样如果我按下按钮,我将执行一些操作。我以编程方式创建了导航栏;navBar=[[UINavigationBaralloc]initWithFrame:CGRectMake(0,0,320,44)];同样,我需要在此导航栏的右侧添加按钮。对于我使用的,1.UIView*container=[[UIViewalloc]init];//createabuttonandaddittothecontainerUIButton*button=[[UIButtonalloc]initWithFrame:CGRectMake(0,0,130,44.01

objective-c - 以编程方式将按钮添加到导航栏

您好,我需要在右侧的导航栏中以编程方式设置按钮,这样如果我按下按钮,我将执行一些操作。我以编程方式创建了导航栏;navBar=[[UINavigationBaralloc]initWithFrame:CGRectMake(0,0,320,44)];同样,我需要在此导航栏的右侧添加按钮。对于我使用的,1.UIView*container=[[UIViewalloc]init];//createabuttonandaddittothecontainerUIButton*button=[[UIButtonalloc]initWithFrame:CGRectMake(0,0,130,44.01

objective-c - 升级到 Xcode 5.1 和 iOS 7.1 后,在 segue 过渡期间导航栏上出现暗影

当我在主-细节导航Controller中的父Controller和子Controller之间来回导航时,我在顶部导航栏的右侧看到一个黑色阴影。它是在我升级到Xcode5.1后开始的。感觉粗糙和分散注意力。我怎样才能摆脱它? 最佳答案 self.navigationController.view.backgroundColor=[UIColorwhiteColor];我通过设置导航ControllerView的背景色解决了这个问题。 关于objective-c-升级到Xcode5.1和iO