NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:@"直接进入"]; NSRange strRange = {0,[str length]}; [str addAttribute...
分类:
其他好文 时间:
2015-09-24 14:17:31
阅读次数:
238
但是如果把masksToBounds设置为yes就没有阴影了UIButton*view=[[UIButtonalloc]initWithFrame:CGRectMake(100,100,100,100)];view.backgroundColor=[UIColorredColor];view.lay...
分类:
移动开发 时间:
2015-09-23 16:25:05
阅读次数:
170
一、欢迎页面3个全屏图片第三个图片可以点击,进入“首页”;一运行起来就是一个ViewController,里面是全屏的ScrollerView与代码关联。代码:-(void)viewDidLoad{[superviewDidLoad];for(inti=1;i<4;i++){UIButton*btn=[[UIButtonalloc]initWithFrame:CGRectMake((i-1)*320,..
分类:
其他好文 时间:
2015-09-22 19:07:21
阅读次数:
190
UIButton的竖排图片和文本UIButton的竖排图片和文本第一想法:实现思路第二种方法UIContentHorizontalAlignment/UIControlContentVerticalAlignment完整代码片段:参考资料:UIButton的竖排图片和文本UIButton的竖排的话,...
分类:
其他好文 时间:
2015-09-22 06:33:55
阅读次数:
243
//左对齐[_btnsetContentHorizontalAlignment:UIControlContentHorizontalAlignmentLeft];//省略号靠右侧_btn.titleLabel.lineBreakMode=NSLineBreakByTruncatingTail;
分类:
其他好文 时间:
2015-09-21 13:54:45
阅读次数:
477
本文主要介绍了两种改写UIButton的点击事件方法——继承UIButton跟给UIButton添加一个分类。附代码方法一:继承UIButtonUIButtonBlock.h文件 如下#import typedef void (^ClickActionBlock) (id obj);@interfa...
分类:
其他好文 时间:
2015-09-20 23:40:41
阅读次数:
188
对于之前一直使用C#语言的我来说,刚开始接触Objective-c来创建对象时很迷惑,为何创建对象一般情况下需要通过发送两个消息(调用两个方法)才能创建一个类实例对象(例如[[UIButton alloc] init])?相信使用Java的也会有这样的感受,给个类型调用一下初始化方法不就完了吗?.....
分类:
其他好文 时间:
2015-09-19 15:20:32
阅读次数:
149
不知道大家有木有碰到下面这种图标,其实这种在iOS应用上是经常看到的,拿到这种样式的东西怎么做呢?封装,UIImageView+UILabel+UILabel加到UIButton上就可以了,但是这个局限性太大了,很多时候根本达不到那种效果,比如点击阴影,使用的流畅性!这时候我们就得想办法了,而最直接...
分类:
其他好文 时间:
2015-09-18 23:12:09
阅读次数:
252
-(void)OnTapCollectBtn:(UIButton *)sender{ [UMSocialSnsService presentSnsIconSheetView:self appKey:UMAPPKEY...
分类:
其他好文 时间:
2015-09-17 23:24:41
阅读次数:
251