私は回転するサークルを持っています。どうすれば彼にも回転するラベルを付けることができますか? 私のポイントは、円とラベルが同じ天使にある必要があるということです。
2 に答える
1
ラベルを、円を表示するために使用している UIView のサブビューにします。IB では、円の画像に使用している UIView にラベルをドラッグするか、IB を使用していない場合は、次のようにラベルを円に追加します。
[circleUIView addSubview:theUILabel];
于 2012-07-29T14:30:03.707 に答える
0
Download demo source code this url http://www.devedup.com/index.php/2010/03/03/iphone-animate-an-object-along-a-path/
Now changes into Canvas.m file's animateCicleAlongPath method.
Replace to image to label.
UILabel *label = [[UILabel alloc]init];
[label setText:@"test"];
[label setTextColor:[UIColor redColor]];
//Set the frame of the view - which is used to position it when we add it to our current UIView
label.frame = CGRectMake(1, 1, 20, 20);
label.backgroundColor = [UIColor clearColor];
[self addSubview:label];
[label.layer addAnimation:pathAnimation forKey:@"moveTheSquare"];
于 2012-07-30T13:40:34.423 に答える