【UIKit-110-1】#import <UIKit/UITableView.h> 基础创建
2015-09-27 12:13
399 查看
@interface UITableView :
UIScrollView <NSCoding>
@property (nonatomic,
readonly) UITableViewStyle style;
@property (nonatomic,
assign) id <UITableViewDataSource> dataSource;
@property (nonatomic,
assign) id <UITableViewDelegate> delegate;
@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);
// 可以设置背景图片。
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"]];
相关文章推荐
- Auto Layout界面自动布局 (Interface Builder布局)
- Longest Consecutive Sequence
- Qt Quick 布局演示
- SpriteBuilder中锚点的一般用法
- SpriteBuilder中锚点的一般用法
- SpriteBuilder中锚点的一般用法
- Git Hub 上面的pull request解释
- iOS --- UICollectionView中使用reloadItemsAtIndexPaths进行局部cell更新
- UCGUI编程三:背景窗口重绘
- 【UIKit-93-2】#import <UIKit/UIScrollView.h>
- UGUI 新手指引
- Java中GUI相关控件常见问题详解
- iOS7极限编程 第一部分 第二章 世界是扁平化的:新的UI范式 (译)
- 第11章:最长公共子序列(LCS:Longest Common Subsequence)
- *LeetCode-N-Queens
- 从为什么String=String谈到StringBuilder和StringBuffer
- 【UIKit-93-1】#import <UIKit/UIScrollView.h>
- IOS 使用Autolayout实现UITableView的Cell动态布局和高度动态改变
- Patterns for Building and Deploying Microservices
- Java Ant build.xml详解