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.
私はUIButtonの背景画像のために以下の画像を持っています。ただし、UIbutton の形状はデフォルトでは丸い四角形です。そのため、イベント内のタッチアップは丸い四角形の領域でのみ機能します。では、形状の下(領域全体)のイベント内でタッチアップをサポートするにはどうすればよいですか。
UIButtonTypeCustom を使用して、正しいフレームを指定できます。
このリンクがお役に立てば幸いです。
不規則な形状のボタンを作成するには、カスタム ボタンを作成し、hitTest を実行して、ボタンが押されたか、空白が押されたかを確認する必要があります。