随笔分类 -  iOS开发代码

代码技巧类
摘要:(一)关于UITableView1.任意设置Cell选中状态的背景色:UIView*bgView = [[UIViewalloc]init];bgView.backgroundColor=[UIColor orangeColor];self.selectedBackgroundView= bgView;[bgViewrelease];该方法设置的是纯色, 也可以使用任何图片,把selectedBackgroundView设成UIImageView。2.如果Table中有控件,这里以switch为例(适合其它可修改值的各种控件),要在switch的UIControlEventValueChang 阅读全文
posted @ 2012-08-16 10:47 appcode 阅读(317) 评论(0) 推荐(0)
摘要:准备:字体文件(.ttf,.odf)方法1: 添加对应的字体(.ttf或.odf)到工程的resurce,使用cocos2d中的FontLabel库,FontLabel继承于UILabel,象UILabel一样使用就好了 fontName直接使用添加的资源名字即可。方法2: 1.添加对应的字体(.ttf或.odf)到工程的resurce,例如my.ttf 2.在info.plist中添加一项 Fonts provided by application (item0对应的value为my.ttf,添加多个字体依次添加就可以了) 3.使用时 aLabel.font=[UIFont fon... 阅读全文
posted @ 2012-06-27 16:50 appcode 阅读(289) 评论(0) 推荐(0)