自定义UITableViewCell 的选中背景图片
2012-10-09 10:58
369 查看
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:kCellIdentifier] autorelease]; cell.selectionStyle = UITableViewCellSelectionStyleBlue; //只有设置这个选择类型,后面的selectedBackgroundView才有作用,不然设置none的话就不起作用 /* Background */ cell.backgroundView = [[[UIImageView alloc] init] autorelease]; cell.selectedBackgroundView = [[[UIImageView alloc] init] autorelease]; } cell.backgroundView.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"customBackground"]]; cell.selectedBackgroundView.backgroundColor = [UIColor redColor]; return cell; }
相关文章推荐
- UITableViewCell 自定义默认选中 和 改变cell背景图片
- 自定义UITableViewCell 的选中背景图片
- 自定义UITableViewCell 的选中背景图片
- IE7下按钮<input>不显示自定义背景图片
- 自定义VFP主窗口背景图片填充方式
- android之4.0控件switch自定义开关背景图片和控制宽度
- ios 设置UITableView 选中行cell的背景颜色(自定义选中的背景颜色)
- iOS UItableviewCell 自定义选中颜色及默认选中首行
- IDEA和Android Studio设置自定义背景图片
- iOS之UITabarController选中按钮背景图片颜色问题
- 自定义View(擦除蒙版得到背景,存储图片,更换背景)
- android checkbox 自定义选中背景
- IE7下按钮<input>不显示自定义背景图片
- IE7下按钮<input>不显示自定义背景图片
- 自定义UitableViewcell 加载大图片的内存优化问题
- android 自定义button背景图片及事件——自定义控件学习(一)
- 关于切换自定义组件(Button,CheckBox,EditText)被点击或选中时背景的方法
- UINavigationBar的背景自定义图片
- Tableview 默认选中第一行以及选中背景自定义
- 自定义 RadioButton 选中和未选中时的图片