gpt4 book ai didi

IOS 7.0 : How to change values of layer. 导航按钮的角半径

转载 作者:行者123 更新时间:2023-11-28 22:07:08 24 4
gpt4 key购买 nike

有没有办法改变导航栏默认按钮的圆角半径?

或者最好的方法是创建一个自定义按钮,并在导航栏中设置这个按钮。

NSDictionary *rightAttributes = [NSDictionary dictionaryWithObjectsAndKeys:
[UIFont fontWithName:@"myFont" size:12.0], UITextAttributeFont,
nil];

[self.navigationItem.rightBarButtonItem setTitleTextAttributes:rightAttributes forState:UIControlStateNormal];
//self.navigationItem.rightBarButtonItem.layer.cornerRadius = 5; //Don'tWork

谢谢。

最佳答案

您可能想要创建一个 BarButtonItem,然后将其设置为具有自定义 View 的 rightBarButtonItem。有点像

 UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithCustomView:aView];
item.customView.layer.cornerRadius = 5;

祝你好运。

关于IOS 7.0 : How to change values of layer. 导航按钮的角半径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23699736/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com