0

I was wondering how to make the UIToolbar look transparent like the photos app where it allows the photo below it to be seen. I have my UIToolbar placed in IB. In IB, I set both the tintColor and backgroundColor to ClearColor.

In code, I also do:

_webViewToolbar.translucent = YES;
_webViewToolbar.alpha = 0.5;

Unfortunately, it only looks like this:

enter image description here

Any thoughts? Thanks!

4

1 回答 1

0

检查以下代码行

 _toolbar.barStyle = UIBarStyleBlackTranslucent;//Deprecated

编辑

  _toolbar.barStyle = UIBarStyleBlack;
  _toolbar.translucent = YES;

检查UIInterface.hUIKit.Framework

你会发现以下

// for UINavigationBar and UIToolBar

 typedef enum {
 UIBarStyleDefault          = 0,
 UIBarStyleBlack            = 1,

 UIBarStyleBlackOpaque      = 1, // Deprecated. Use UIBarStyleBlack
 UIBarStyleBlackTranslucent = 2, // Deprecated. Use UIBarStyleBlack and set the translucent property to YES
 } UIBarStyle;

问候,尼尔。

于 2012-05-16T04:34:12.777 回答