一个demo引发的思考

留一个blog,随时记录跑demo,写demo过程中遇到的各种问题,走过的路都留下一个脚印,方便后来的人少走弯路!

1、project支持iphone 5-- 2013年07月19日17:00

跑一个 apple官方的 demo

demo已经很老了,还支持ios 3.2,sdk还支持iphoneos 4.0……

然后,我拿着它在我的iphone5 上跑。感觉还不错,然后,发现个问题,最底下两排怎么不能点……

然后……然后……经过不下一刻钟的在xib上找啊找,总算弄好

是因为没有设置MainWindow.xib文件的window上的一个属性,点击window,在Window属性中把“Full Screen at Launch”复选框勾选上就OK了;

ps:我承认我ib用的不好,我承认我一直是个菜鸟。……进步,进步!

2、Could not change executable permissions on the application.--2013-07-22 08:51

翻译过来就是:无法更改可执行权限上的应用。

就是你同一个bundle identifier  往iphone里装了两个(用了同一个证书的)程序,冲突了。  你用这个账号运行了另一个程序,而那个程序的bundle id和这个一样。就会弹出那个对话框。 bundle identifier是可以相同的,但相同的bundle identifier要求有相同的Target Name才可以。So, 

解决办法:就是你把 另一个使用这个证书的app删掉就可以了!

3、为UIView 边缘增加一个渐变的阴影效果,2013年07月22日22:22。

方法一:

- (CAGradientLayer *)shadowOfView:(float)frameHeight
{
    CAGradientLayer *newShadow = [[[CAGradientLayer alloc] init] autorelease];
    CGRect newShadowFrame = CGRectMake(0, 0, 5, frameHeight);
    newShadow.frame = newShadowFrame;
    //添加渐变的颜色组合
    //第一个为start color,第二个为end color
    newShadow.colors = [NSArray arrayWithObjects:(id)[UIColor blackColor].CGColor,(id)[UIColor clearColor].CGColor,nil];
    newShadow.startPoint=CGPointMake(0.0, 0.5);
    newShadow.endPoint=CGPointMake(1.0, 0.5);
    return newShadow;
}

4、类似path效果的点“+”号然后旋转45度效果,2013年07月31日10:07。

这个其实简单,归根到底效果其实就是旋转imageView

    float angle = isOpen ? -M_PI_4 : 0.0f;
    [UIView animateWithDuration:0.2f animations:^{
        _imageView.transform = CGAffineTransformMakeRotation(angle);
    }];


5、IOS在View上最简单的划线代码,2013-11-27 14:08。

- (void)drawRect:(CGRect)rect { [super drawRect:rect]; CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetStrokeColorWithColor(context, [UIColor redColor].CGColor); // Draw them with a 2.0 stroke width so they are a bit more visible. CGContextSetLineWidth(context, 2.0); CGContextMoveToPoint(context, 0,0); //start at this point CGContextAddLineToPoint(context, 20, 20); //draw to this point // and now draw the Path! CGContextStrokePath(context); }



未完待续

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值