开发者

How to change the background of a toolbar

开发者 https://www.devze.com 2023-01-23 01:55 出处:网络
How do I change the toolbar\'s backg开发者_StackOverflowround?Why not just adjust the tintColor property? Or is changing the tint not good enough for your purposes?There\'s one common technique, which

How do I change the toolbar's backg开发者_StackOverflowround?


Why not just adjust the tintColor property? Or is changing the tint not good enough for your purposes?


There's one common technique, which is a giant hack, but it seems to work. Subclass UIToolbar and override -drawRect: and just have that draw whatever you want. You can then create instances of the subclass whenever you need a toolbar, and if you have a toolbar in a xib file then you can just select it and change the class to whatever your subclass is.

0

精彩评论

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