6.088939584326 坐标系58E-6中E的意思

UITableView更改左滑删除按钮的背景颜色和字体大小 - 简书
<div class="fixed-btn note-fixed-download" data-toggle="popover" data-placement="left" data-html="true" data-trigger="hover" data-content=''>
写了59895字,被329人关注,获得了357个喜欢
UITableView更改左滑删除按钮的背景颜色和字体大小
在自定义的cell里重写layoutSubviews方法
import "TestCell.h"
@implementation TestCell
-(void)layoutSubviews{
[super layoutSubviews];
for (UIView *subView in self.subviews)
if([subView isKindOfClass:NSClassFromString(@"UITableViewCellDeleteConfirmationView")])
UIView confirmView=(UIView *)[subView.subviews firstObject];
//改背景颜色
confirmView.backgroundColor=[UIColor purpleColor];
for(UIView *sub in confirmView.subviews)
if([sub isKindOfClass:NSClassFromString(@"UIButtonLabel")])
UILabel *deleteLabel=(UILabel )
//改删除按钮的字体大小
deleteLabel.font=[UIFont boldSystemFontOfSize:20];
//改删除按钮的文字
deleteLabel.text=@"峰哥";
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
打开微信“扫一扫”,打开网页后点击屏幕右上角分享按钮
被以下专题收入,发现更多相似内容:
分享 iOS 开发的知识,解决大家遇到的问题,讨论iOS开发的前沿,欢迎大家投稿~
· 29085人关注
【最新投稿方式】
为了保证专题文章的质量,暂时关闭投稿申请,改为【私信文章链接】给本专题的管理员 (花前月下) (判若...
· 7855人关注
开发者加入开发者讨论群!
· 2533人关注
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
选择支付方式:iOS开发中设置UITableViewCell选中时的颜色
用圣才电子书APP或微信扫一扫,在手机上阅读本文,也可分享给你的朋友。
来源:网络 作者:未知
1.系统默认的颜色设置
cell.selectionStyle&=&UITableViewCellSelectionStyleN&&
cell.selectionStyle&=&UITableViewCellSelectionStyleB&&
cell.selectionStyle&=&UITableViewCellSelectionStyleG&&
2.自定义颜色和背景设置
改变UITableViewCell选中时背景色:
UIColor&*color&=&[[UIColoralloc]initWithRed:0.0green:0.0blue:0.0alpha:1];//通过RGB来定义自己的颜色&
cell.selectedBackgroundView&=&[[[UIView&alloc]&initWithFrame:cell.frame]&autorelease];&&
cell.selectedBackgroundView.backgroundColor&=&[UIColor&xxxxxx];&&
3.自定义UITableViewCell选中时背景
cell.selectedBackgroundView&=&[[[UIImageView&alloc]&initWithImage:[UIImage&imageNamed:@&cellart.png&]]&autorelease];&&
还有字体颜色&&
cell.textLabel.highlightedTextColor&=&[UIColor&xxxcolor];&[cell.textLabel&setTextColor:color]&
4.设置tableViewCell间的分割线的颜色
[theTableView&setSeparatorColor:[UIColor&xxxx&]];&
5、设置cell中字体的颜色
Prettyprint代码
&span&style=&color:&#888888;&&class=&com&&//&Customize&the&appearance&of&table&view&cells.
&/span&&span&style=&color:&#000000;&&class=&pun&&-&/span&&span&style=&color:&#000000;&&
class=&pun&&(&/span&&span&style=&color:&#000088;&&class=&typ&&UITableViewCell&/span&
&span&style=
&color:&#000000;&&class=&pun&&*)&/span&&span&style=&color:&#000000;&&class=&pln&&tableView&/span&&span&style=&color:
&#000000;&&class=&pun&&:(&/span&&span&style=&color:&#000088;&&class=&typ&&UITableView&/span&&span&style=
&color:&#000000;&&class=&pun&&*)&/span&&span&style=&color:&#000000;&&class=&pln&&tableView&cellForRowAtIndexPath
&/span&&span&style=&color:&#000000;&&class=&pun&&:(&/span&&span&style=&color:&#000088;&&class=&typ&&NSIndexPath&/span&&span&
style=&color:&#000000;&&class=&pun&&*)&/span&&span&style=&color:&#000000;&
&class=&pln&&indexPath&
&/span&&span&style=&color:&#000000;&&class=&pun&&{&/span&&span&style=&color:&
#000000;&&class=&pln&&&
&&&/span&&span&style=&color:&#880000;&&class=&kwd&&if&/span&&span&style=&color:&
#000000;&&class=&pun&&(&/span&&span&style=&color:&#006666;&&class=&lit&&0&/span&
&span&style=&color:&
#000000;&&class=&pun&&==&/span&&span&style=&color:&#000000;&&class=&pln&&
&indexPath&/span&&span&style=&color:&#000000;&&class=&pun&&.&/span&&span&
style=&color:&#000000;&&class=&pln&&row&/span&&span&style=&color:&#000000;&&
class=&pun&&)&/span&&span&style=&color:&#000000;&&class=&pln&&&
&&&/span&&span&style=&color:&#000000;&&class=&pun&&{&/span&&span&style=&color:&
#000000;&&class=&pln&&&
&&&&cell&/span&&span&style=&color:&#000000;&&class=&pun&&.&/span&&span&style=&color:
&#000000;&&class=&pln&&textLabel&/span&&span&style=&color:&#000000;&&class=&pun&&
.&/span&&span&style=&color:&#000000;&&class=&pln&&textColor&&/span&&span&style=
&color:&#000000;&&class=&pun&&=&/span&&span&style=&color:&#000000;&&class=&pun&&
...;&/span&&span&style=&color:&#000000;&&class=&pln&&&
&&&&cell&/span&&span&style=&color:&#000000;&&class=&pun&&.&/span&&span&style=&color:
&#000000;&&class=&pln&&textLabel&/span&&span&style=&color:&#000000;&&class=&pun&&.
&/span&&span&style=&color:&#000000;&&class=&pln&&highlightedTextColor&&/span&&span
&style=&color:&#000000;&&class=&pun&&=&/span&&span&style=&color:&#000000;&&
class=&pun&&...;&/span&&span&style=&color:&#000000;&&class=&pln&&&
&&&/span&&span&style=&color:&#000000;&&class=&pun&&}&/span&&span&style=&color:&
#000000;&&class=&pln&&&
&&&/span&&span&style=&color:&#000000;&&class=&pun&&...&/span&&span&style=&color:&
#000000;&&class=&pun&&}&/span&&
小编工资已与此赏挂钩!一赏一分钱!求打赏↓ ↓ ↓
如果你喜欢本文章,请赐赏:
已赐赏的人
我的电子书}

我要回帖

更多关于 3857转 4326 坐标系 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信