是否可以为 UITableView 添加边框样式?
不仅仅是边框颜色和边框宽度。
例如凹槽边框样式?
嘿,您可以使用以下方式为您的视图添加边框CALayer
可以在QuartzCore Framework
以下链接将帮助您了解CALayer
详细。
CALayers 教程简介
例如,从上面的链接,
// Import QuartzCore.h at the top of the file
#import <QuartzCore/QuartzCore.h>
// In viewDidLoad add the following lines
self.view.layer.backgroundColor = [UIColor orangeColor].CGColor;
self.view.layer.cornerRadius = 20.0;
self.view.layer.frame = CGRectInset(self.view.layer.frame, 20, 20);
CALayer *sublayer = [CALayer layer];
sublayer.backgroundColor = [UIColor blueColor].CGColor;
sublayer.shadowOffset = CGSizeMake(0, 5);
sublayer.shadowRadius = 5.0;
sublayer.shadowColor = [UIColor blackColor].CGColor;
sublayer.shadowOpacity = 1.0;
sublayer.frame = CGRectMake(30, 30, 128, 192);
[self.view.layer addSublayer:sublayer];
虽然上面的代码不会给你确切的凹槽效果。但你可以尝试一下。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)