开发者

Transparency for top UIView not working

In a UINavigationController I have a UITableView. I use a settings-button to allow users changing some table settings.

When the settings-button is t开发者_运维百科apped I push a new view onto the navigation stack.

This new view has the following view structure

-> UIView1 411 x 320 px (backgroundColor supposed to be transparent) !!!!

-->> UIView2 270 x 300 px (backgroundColor grey)

--->>> Screen elements

My problem is that I want UIView1 to be transparent so that the information behind is still visible. All my attempts, such as

  • setting the bg color to transparent

  • changing the alpha value

  • removing the Opaque indicator

have failed so far.

Any clues? most appreciated!


UINavigationController is not designed to allow "buried" view controllers to still be showing under the current visible view controller. (The iOS framework can actually unload the views of view controllers on the nav stack that aren't the current top item!)

So if you try to do it, it just won't work, or you'll have problems. (Same goes for modal view controllers on the iPhone -- even if you make the background transparent, the view you're pushing on top of will disappear.)

If you really want the old UI to still be visible underneath, consider presenting your new entire UI as a UIView placed over the current view (i.e. do [existingView addSubview:myNewView]).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜