UITableView样式的自定义
来源:互联网 发布:郑州淘宝加盟判刑 编辑:程序博客网 时间:2024/05/17 01:48
// 返回cell
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
}
cell.accessoryType = UITableViewCellAccessory
@property(nonatomic) UITableViewCellAccessory
@property(nonatomic,retain) UIView
@property(nonatomic) UITableViewCellAccessory
@property(nonatomic,retain) UIView
- (void) performExpand:(id)paramSender{
}
通过,上面一步,我们为Cell添加了一个自定义的按钮。
也许就会遇到这么一个纠结的情况,当点击UITableViewCell高亮时,其子视图中不该高亮的对象(比如说自定义的那个按钮)也高亮了。
比如:
正确方式:我们需要cell被选中时,按钮不应该也被高亮显示。如:
错误方式:但是,cell被选中时,按钮却也高亮显示了。如:
- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated{
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated{
}
因为当UITableViewCell为选中状态时,UITableViewCell把selectedBackgroundView当作一个子视图来添加;
selectedBackgroundView被添加在UITableViewCell的backgroundView之上,或者所有其它视图之下。
当调用setSelected: animated:这一方法时,会导致selectedBackgroundView以一个alpha消化的状态来出现和消失。
还应该注意:
UITableViewCell的selectionStyle值为UITableViewCellSelection
// 设置背景
[self setBackgroundImageByName
[self setBackgroundImage:[UIImage imageNamed:@"table_live_bg.png"]];
[self.contentView insertSubview:messageBackgroundView belowSubview:self.textLabel];
//定制Delete字符串,添加函数 返回要显示的字符串
-(NSString *)tableView:(UITableView*)tableView titleForDeleteConfirmati
}
- UITableView样式的自定义
- UITableView 样式的自定义
- UITableView样式的自定义
- UITableView-的cell 自定义 高度,样式
- 自定义UITableView的左滑动样式
- UITableView 应用(五)UITableView样式的自定义
- [转载]UITableView 应用(五)UITableView样式的自定义
- 自定义UITableView的Section的title的样式
- 自定义UITableView的Section的title的样式
- UITableView普通的样式
- 自定义UITableView的Header
- UITableView 的 自定义cell
- UITableView的自定义cell
- [iOS UItableView 自定义Section] 自定义Section 修改title样式
- UITableView样式
- iOS8使用UITableViewRowAction自定义UITableView左划样式
- UITableView的Group样式的详细使用
- iOS Uitableview的cell的选中样式
- 补码问题
- hdu 4010(LinkCutTree)
- C++整型\字符串\数组的相互转换
- 树形DP总结(转)
- SPOJ - WMELON(离散化+暴力or离散化+线段树)【待完善】
- UITableView样式的自定义
- 涂鸦 画线
- android noclassdeffounderror:jxl.workbook
- 生活杂记
- 备份恢复基础复习
- presentModalViewController和dismissModalViewControllerAnimated的使用总结
- vb.net中存储过程的使用
- android之SeekBar和RatingBar
- Webservice_08_JAXB处理java和xml