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

来源:互联网 发布:源码授权是什么 编辑:程序博客网 时间:2024/05/22 00:26



@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                     estimatedRowHeightNS_AVAILABLE_IOS(7_0);// 估计行高

@property (nonatomic)         CGFloat                     estimatedSectionHeaderHeightNS_AVAILABLE_IOS(7_0);// 估计表头高

@property (nonatomic)         CGFloat                     estimatedSectionFooterHeightNS_AVAILABLE_IOS(7_0);// 估计表尾高

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


@property(nonatomic,readwrite, retain) UIView *backgroundViewNS_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"]];    





0 0
原创粉丝点击