导航栏的圆角半径

问题描述:

我开发了一个iPad应用程序。在那个应用程序中,我有4个单独的视图控制器内嵌的独立视图,每个视图都有一个导航栏。我想设置每个导航栏的角半径。导航栏的圆角半径

我试图

 customNavigationBar.layer.cornerRadius = 25; 

但这段代码不工作。有谁知道如何为每个导航栏设置拐角半径。

customNavigationBar.layer.cornerRadius=25; 
customNavigationBar.clipsToBounds=YES; 

我已经成功地进行了测试

+0

谢谢....它为我工作2 – Sandy 2012-03-14 12:46:52

添加角落圆角图像作为导航栏的背景以使其发生。检查此链接Applying rounded corners for the whole application

附加quartcore框架和比

在头

#import <QuartzCore/QuartzCore.h> 

的.h文件中,并编写代码如下

self.navigationController.navigationBar.layer.cornerRadius=25; 
+0

完成这个不工作.... – Sandy 2012-03-14 11:43:55