开发者

User interface (how to change background)

How i may change background for window? I have a Button, set Style "Round rect", set Type "On Off", set State "On"-how i may change background color from gray to blue? And how 开发者_StackOverflow社区i may change background for all app?

Thanks!!!


In iOS window based application , you have to create the link between UserInterface to the Code.

  1. Add IBAction in your app delegate file. Let say "changeBG"

-(void) IBAction changeBG { self.window.backgroundColor = [UIColor blueColor]; }

  1. Connect the Interface with code by Open XIB and control-click to AppDelegate, when popup appear select changeBG

For UIControlEvent , I recommend UIControlEventTouchUpInside for beginner. That's it. Hope you can do it.

control-click from your button to

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜