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.
drawInRectの正確な使用法を追跡するのに問題があります。構文は知っていますが、UIViewまたはそのサブクラス内でのみ使用できますか?必要な「コンテキスト」とは正確には何ですか。また、それを作成または取得するにはどうすればよいですか。
コンテキストは、コア グラフィック描画のキャンバスのようなものです。UIGraphicsGetCurrentContext()内で呼び出すことにより、任意の UIView からコンテキストを取得できますdrawRect:。UIImage を作成したり、ファイルに保存したりできる独自のコンテキストを任意の場所に作成することもできます。
UIGraphicsGetCurrentContext()
drawRect:
お役に立てれば!