Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/drupal/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Cocoa touch iPhone-使选项卡栏透明_Cocoa Touch_Uikit - Fatal编程技术网

Cocoa touch iPhone-使选项卡栏透明

Cocoa touch iPhone-使选项卡栏透明,cocoa-touch,uikit,Cocoa Touch,Uikit,如何在cocoa touch中使选项卡栏透明?既然uitabar是UIView的子类,您是否尝试过调整其alpha属性 注意,如果您试图修改与 UITabBarController < /代码>相关联的选项卡,则应该考虑来自Apple的警告,位于: 重要提示:在iOS 3.0及更高版本中,您 不应尝试使用这些方法 以及要修改的此类的属性 与关联时的选项卡栏 选项卡栏控制器对象。修改 这样的选项卡栏会导致 抛出异常。相反,任何 对选项卡栏或其 项目应该通过选项卡栏出现 控制器接口。你仍然可以 直接

如何在cocoa touch中使选项卡栏透明?

既然
uitabar
UIView
的子类,您是否尝试过调整其
alpha
属性

注意,如果您试图修改与<代码> UITabBarController < /代码>相关联的选项卡,则应该考虑来自Apple的警告,位于:

重要提示:在iOS 3.0及更高版本中,您 不应尝试使用这些方法 以及要修改的此类的属性 与关联时的选项卡栏 选项卡栏控制器对象。修改 这样的选项卡栏会导致 抛出异常。相反,任何 对选项卡栏或其 项目应该通过选项卡栏出现 控制器接口。你仍然可以 直接修改一个选项卡栏对象 未与选项卡栏关联 控制器


现在,使用iOS 5,您可以通过一行简单的代码更改UITabBar外观,使背景仅为透明:

[[UITabBar appearance] setTintColor:[[UIColor alloc] initWithRed:0 green:0 blue:0 alpha:0.2]];

谢谢,阿尔法正是我需要的。对于任何需要尝试此功能的其他人。假设您的tabbar被称为tabbar just go:tabbar.alpha=0.5//将透明度设置为50%,这将转到哪里?我在
应用程序中尝试了它:使用选项完成启动:
,但没有效果。