@interface UITableView : UIScrollView <NSCoding>
【索引外观】
具体使用见dataSource
@property (nonatomic) NSInteger sectionIndexMinimumDisplayRowCount; // section索引值,row大于多少是显示。
@property (nonatomic, retain) UIColor *sectionIndexColor NS_AVAILABLE_IOS(6_0) UI_APPEARANCE_SELECTOR; // 索引颜色
@property (nonatomic, retain) UIColor *sectionIndexBackgroundColor NS_AVAILABLE_IOS(7_0) UI_APPEARANCE_SELECTOR; // 索引背景颜色
@property (nonatomic, retain) UIColor *sectionIndexTrackingBackgroundColor NS_AVAILABLE_IOS(6_0) UI_APPEARANCE_SELECTOR; // 索引触摸时的颜色。类似高亮。
theTableView.sectionIndexMinimumDisplayRowCount = 1;
theTableView.sectionIndexColor = [UIColor redColor];
theTableView.sectionIndexBackgroundColor = [UIColor yellowColor];
theTableView.sectionIndexTrackingBackgroundColor = [UIColor blueColor];
【分割线】
@property (nonatomic) UITableViewCellSeparatorStyle separatorStyle; // 分割线类型
@property (nonatomic, retain) UIColor *separatorColor UI_APPEARANCE_SELECTOR; // 分割线颜色
@property (nonatomic, copy) UIVisualEffect *separatorEffect NS_AVAILABLE_IOS(8_0) UI_APPEARANCE_SELECTOR; // effect to apply to table separators
theTableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
/*
typedef NS_ENUM(NSInteger, UITableViewCellSeparatorStyle) {
UITableViewCellSeparatorStyleNone,
UITableViewCellSeparatorStyleSingleLine,
UITableViewCellSeparatorStyleSingleLineEtched // 无视他
};
*/
theTableView.separatorColor = [UIColor redColor];<span style="white-space:pre"> </span>//分割线颜色
theTableView.backgroundColor=[UIColor clearColor];<span style="white-space:pre"> </span>// 毛玻璃效果(详情研究 UIVIbrancyEffect)
// 设置毛玻璃
UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
UIVibrancyEffect *vibrancyEffect = [UIVibrancyEffect effectForBlurEffect:blurEffect];
theTableView.separatorEffect = vibrancyEffect;
【表头,表尾】
@property (nonatomic, retain) UIView *tableHeaderView; // 整个表的表头
@property (nonatomic, retain) UIView *tableFooterView; // 整个表的表尾
UIView *redView = [[UIView alloc]initWithFrame:CGRectMake(110, 10, 11, 111)];
redView.backgroundColor = [UIColor redColor];
theTableView.tableHeaderView = redView;
【注册cell样式】
- (id)dequeueReusableCellWithIdentifier:(NSString *)identifier; // cell样式
- (id)dequeueReusableCellWithIdentifier:(NSString *)identifier forIndexPath:(NSIndexPath *)indexPath NS_AVAILABLE_IOS(6_0); // cell样式(indexpath)
- (id)dequeueReusableHeaderFooterViewWithIdentifier:(NSString *)identifier NS_AVAILABLE_IOS(6_0); // 表头表尾
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"UITableViewCell"];
其他类似