Iphone 导航栏按钮
当我在导航栏中放置两个右栏按钮时,这两个按钮是可见的,但它们有一个上边框,这意味着我不想要那个边框 我正在我的框架中创建这些按钮,并将该框架指定给导航栏。如何隐藏边框 我的代码如下:Iphone 导航栏按钮,iphone,ios,uikit,Iphone,Ios,Uikit,当我在导航栏中放置两个右栏按钮时,这两个按钮是可见的,但它们有一个上边框,这意味着我不想要那个边框 我正在我的框架中创建这些按钮,并将该框架指定给导航栏。如何隐藏边框 我的代码如下: UIBarButtonItem *btnAdd = [[UIBarButtonItem alloc] initWithTitle:@"Add" style:UIBarButtonItemSt
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];
在框架标记中设置frameborder=“0”,它将禁用框架
如果链接按钮并显示边框,则使用css重写链接属性:
a:link {color:#FF0000;} /* unvisited link */
a:visited {color:#00FF00;} /* visited link */
a:hover {color:#FF00FF;} /* mouse over link */
a:active {color:#0000FF;} /* selected link */
有关帮助,请阅读此
UIBarButtonItem *btnAdd = [[UIBarButtonItem alloc] initWithTitle:@"Add"
style:UIBarButtonItemStylePlain
target:self
action:@selector(Add)];
而不是使用
style:UIBarButtonItemStyleBordered
你能提供一个屏幕截图或一些与此相关的代码吗?但在那个按钮中,它看起来并不漂亮。你可以在这里使用一个自定义按钮和一个图像。这意味着普通按钮看起来太大,在用户界面中看不到。我不想使用图像。我使用简单文本作为两个按钮的添加和编辑。