I have a UINavigationBar with a pattern on it. I've seen a lot of UI that implement transparent UIBarButtonItem, and I wonder how to make the same.

Tint dosent do the trick unfortunately...

please help...

有帮助吗?

解决方案

Put a UIButton inside the UIBarButton item. The button can be transparent. In Xcode's Interface Builder, just drag a UIButton to one of the empty corners of the UINavigationBar. Xcode will automatically create a UIBarButtonItem and put the UIButton inside it. You can then set the UIButton type to Custom and apply other properties such as title or image.

其他提示

Follow the procedure described by Melsam and set the transparency of the button by using

button.backgroundColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.5];

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top