iphone如何使uitableviewcellaccessorydisclosureindicator背景透明? [英] iphone how to I make a uitableviewcellaccessorydisclosureindicator background transparent?

查看:53
本文介绍了iphone如何使uitableviewcellaccessorydisclosureindicator背景透明?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以向我解释一下如何使UITableViewCell中的uitableviewcellaccessorydisclosureindicator的背景透明吗?

Can someone please explain to me how I can make a uitableviewcellaccessorydisclosureindicator's background in a UITableViewCell transparent?

现在我正面临这个问题:

Right now I'm facing this problem:

替代文字http://www.bubl3r.com/disclosure.jpg

推荐答案

刚刚找到了答案.原来只有3行必须定义具有透明背景的我自己的公开指标.png图像:

Just found the answer. Turns out it was just 3 lines & having to define my own disclosure indicator .png image with a transparent background:

UITableViewCell *bgView = [[UITableViewCell alloc] initWithFrame:CGRectZero];
    bgView.backgroundColor=indexPath.row % 2? [UIColor colorWithRed:0.95 green:0.95 blue:0.95 alpha:1]: [UIColor whiteColor];
    bgView.accessoryView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"disclosure.png"]];
    cell.backgroundView=bgView; 


    return cell;

这篇关于iphone如何使uitableviewcellaccessorydisclosureindicator背景透明?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆