您的位置:首页 > 产品设计 > UI/UE

【UIKit-110-1】#import <UIKit/UITableView.h> 基础创建

2015-09-27 12:13 399 查看
@interface UITableView :
UIScrollView <NSCoding>

【基础创建】

- (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style;

@property (nonatomic,
readonly) UITableViewStyle style;

@property (nonatomic,
assign) id <UITableViewDataSource> dataSource;

@property (nonatomic,
assign) id <UITableViewDelegate> delegate;

theTableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 100, self.view.bounds.size.width, 500) style:UITableViewStyleGrouped];
theTableView.delegate = self;
theTableView.dataSource = self;
[self.view addSubview:theTableView];
/*
typedef NS_ENUM(NSInteger, UITableViewStyle) {
UITableViewStylePlain,                  // regular table view
UITableViewStyleGrouped                 // preferences style table view
};
*/


@property (nonatomic)
CGFloat rowHeight;
// 默认行高
@property (nonatomic)
CGFloat sectionHeaderHeight;
// 默认表头高
@property (nonatomic)
CGFloat sectionFooterHeight;
// 默认表尾高

@property (nonatomic)
CGFloat estimatedRowHeight
NS_AVAILABLE_IOS(7_0);
// 估计行高
@property (nonatomic)
CGFloat estimatedSectionHeaderHeight
NS_AVAILABLE_IOS(7_0);
// 估计表头高
@property (nonatomic)
CGFloat estimatedSectionFooterHeight
NS_AVAILABLE_IOS(7_0);
// 估计表尾高

@property (nonatomic)
UIEdgeInsets separatorInset
NS_AVAILABLE_IOS(7_0)
UI_APPEARANCE_SELECTOR;
// 分割线

@property(nonatomic,
readwrite,
retain) UIView *backgroundView
NS_AVAILABLE_IOS(3_2);
// 可以设置背景图片。

theTableView.rowHeight = 44;
theTableView.sectionHeaderHeight = 44;
theTableView.sectionFooterHeight = 66;

theTableView.estimatedRowHeight = 44;
theTableView.estimatedSectionHeaderHeight = 44;
theTableView.estimatedSectionFooterHeight = 66;

theTableView.backgroundView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"dadajie_chenjie"]];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: