【问题标题】:UIToolbar translucent like photos appUIToolbar半透明像照片应用程序
【发布时间】:2012-05-16 04:26:01
【问题描述】:

我想知道如何使 UIToolbar 看起来像照片应用程序一样透明,它允许看到它下面的照片。我将 UIToolbar 放在 IB 中。在 IB 中,我将 tintColor 和 backgroundColor 都设置为 ClearColor。

在代码中,我也这样做:

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

不幸的是,它看起来像这样:

有什么想法吗?谢谢!

【问题讨论】:

    标签: iphone uitoolbar uiappearance


    【解决方案1】:

    检查以下代码行

     _toolbar.barStyle = UIBarStyleBlackTranslucent;//Deprecated
    

    编辑

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

    检查UIKit.Framework 中的UIInterface.h

    你会发现下面的

    // 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;
    

    问候, 尼尔。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-05-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-09-09
      • 1970-01-01
      相关资源
      最近更新 更多