开发者

Cocoa Touch: How to have a controller always visible over other views

I'm relatively new to Cocoa programming, but I've managed to figure a fair amount out. One thing I haven't been able to figure out yet is how to have an element that is visible over all views. Like a volume control that is always visible just above the tab bar at the bottom of the screen.

H开发者_运维问答ow should I go about doing that?


If you just need to bring a view to the front, you can use bringSubviewToFront:, like so:

[self.view bringSubviewToFront:yourSubview];

If you need to position subviews so that they overlap in a certain way, you'll want to make use of CALayer. Just be aware that overlapping UIControl elements goes against Apple's Human Interface guidelines.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜