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.
こんにちは、目に見えないボタンで覆われている画像がいくつかあります。非表示ボタンを押したときに画像が押し下げられたように見せる方法はありますか? ありがとう!
画像をボタンに直接配置できます。別の は必要ありませんUIImageView。
UIImageView
[button setBackgroundImage:image forState:UIControlStateNormal]; [button setBackgroundImage:image forState:UIControlStateSelected];
さらにいくつかのUIControlState定数があります。
UIControlState
ドキュメントを見てください:
http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UIButton_Class/UIButton/UIButton.html
http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UIControl_Class/Reference/Reference.html#//apple_ref/c/tdef/UIControlState