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.
ボタンのタップ時に titleLabel テキストを少し下に移動させたい (つまり、強調表示された状態とデフォルトの状態に異なるインセット値を与えたい)。
カスタムボタンの背景画像があり、ボタンは強調表示された状態の画像で下がりますが、その上のテキストは同じ場所にあるため、悪い効果があり、テキストがボタンから分離されているように見えます.
これを解決する方法はありますか?
前もって感謝します
これを行う最も簡単な方法は、テキストをボタンの背景画像に配置することです。
何らかの理由でそれができない場合は、追加IBActionしButton downて調整してみてくださいbutton.titleLabel.frame。
IBAction
Button down
button.titleLabel.frame