Ios arc4random方法减小了按钮的大小

Ios arc4random方法减小了按钮的大小,ios,ipad,cgrectmake,Ios,Ipad,Cgrectmake,下面是我写的一个方法,可以对震动做出响应,这样按钮就可以随机放置 - (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event { if (motion == UIEventSubtypeMotionShake) { for(int i=0;i<8;i++){ CGAffineTransform angle = CGAffineTransformMakeRo

下面是我写的一个方法,可以对震动做出响应,这样按钮就可以随机放置

- (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event {

    if (motion == UIEventSubtypeMotionShake)

    {
        for(int i=0;i<8;i++){
          CGAffineTransform angle = CGAffineTransformMakeRotation(arc4random());
          shieldButton[i].transform = angle;

          shieldButton[i].frame = CGRectMake(arc4random()%900, arc4random()%400, 140, 171);
        }
    }

}
-(void)motionEnded:(UIEventSubtype)motion with event:(UIEvent*)event{
如果(运动==UIEventSubjectMotionShake)
{

对于(inti=0;i这是来自苹果的文档

警告:如果转换属性不是标识转换,则 此属性的值未定义,因此应忽略


尝试设置边界。

这是苹果的文档

警告:如果转换属性不是标识转换,则 此属性的值未定义,因此应忽略

尝试设置边界