Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私はiPhoneアプリを作成しています。そのアプリケーションでは、添付のスクリーンショットに従ってラベルに角度を付けたいと考えています。(120 ドルのラベルを参照)
赤い色の画像が背景にあり、その上部の uilabel に角度を付けたい
transform回転するメソッドを使用しました。しかし、それは適切に角度を付けません。ラベルが縮む
transform
testLabel.transform = CGAffineTransformMakeRotation(30 * M_PI / 180.0);
フレームの設定が間違っているため、ラベルが縮小します。UIViewラベルを に配置し、ラベルの代わりにこのビューを回転する必要があります。UIViewまた、自動サイズ変更アンカーが有効になっていないことも確認してください。
UIView
このコードを使用してください:
label.transform = CGAffineTransformMakeRotation(2*M_PI / 3);