开发者

User interface (how to change background)

开发者 https://www.devze.com 2023-03-11 12:04 出处:网络
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?

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

精彩评论

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

关注公众号