导航栏button

当我在我的导航栏中放置两个右键栏button时,这两个button是可见的,但他们有一个顶部的边框意味着我不要那个边框。

我在我的框架中创build这些button,并将该框架分配给导航栏。 所以任何人都可以帮助我如何隐藏框架边框。

我的代码如下:

UIBarButtonItem *btnAdd = [[UIBarButtonItem alloc] initWithTitle:@"Add" style:UIBarButtonItemStyleBordered target:self action:@selector(Add)]; UIBarButtonItem *btnEdit = [[UIBarButtonItem alloc] initWithTitle:@"Edit" style:UIBarButtonItemStyleBordered target:self action:@selector(Edit)]; UIToolbar *rightToolBar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 100, 46)]; rightToolBar.backgroundColor = [UIColor clearColor]; rightToolBar.tintColor = [UIColor colorWithRed:40.0/255.0 green:48.0/255.0 blue:51.0/255.0 alpha:0.0]; NSArray *buttonsRight = [NSArray arrayWithObjects:btnEdit, btnAdd, nil]; [rightToolBar setItems:buttonsRight]; self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:rightToolBar]; 

感谢提前。

用这个

 UIBarButtonItem *btnAdd = [[UIBarButtonItem alloc] initWithTitle:@"Add" style:UIBarButtonItemStylePlain target:self action:@selector(Add)]; 

而不是使用

 style:UIBarButtonItemStyleBordered 

在Frame标签中设置frameborder =“0”将禁用框架。

如果你链接一个button,并显示边框,然后使用CSS来重写链接属性

a:link {color:#FF0000;} / *未访问的链接/ a:已访问的{color:#00FF00;} / visited链接/ a:hover {color:#FF00FF; #0000FF;} /选定的链接* /

帮忙阅读:www.w3schools.com/css

reagards