UIColor * cc = [UIColor whiteColor];
NSDictionary * dict = [NSDictionary dictionaryWithObject:cc forKey: NSForegroundColorAttributeName];
self.navigationController.navigationBar.titleTextAttributes = dict;
修改返回按钮的颜色:
[[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];UIWebView滚动时禁止回弹
detailWebView.scrollView.bounces = NO;UIButtonTypeCustom类型的UIButton设置圆角
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
[button.layer setMasksToBounds:YES];
[button.layer setCornerRadius:5.0]; //设置矩形四个圆角半径
[button.layer setBorderWidth:0.1]; //边框宽度
button.titleLabel.font = [UIFont systemFontOfSize: 14.0]; // 字体大小
本文介绍了如何使用UIKit自定义UI元素样式,包括导航栏标题颜色、返回按钮颜色、UIWebView滚动效果以及UIButtonTypeCustom类型按钮的圆角设置等。通过这些技巧可以提升iOS应用界面的一致性和用户体验。
2965

被折叠的 条评论
为什么被折叠?



