开发者

Pickerview within enclosing view

using iphone sdk 4.0. I have added a UIPickerView to a view. I want the UIPickerView to be NON transparent ( as it is) but i want the background 开发者_如何学Cview to have an alpha of 0.3.

THis is so that the upper portion of the view (which is full size screen) is see through and the lower portion which has the picker is solid. However when i set the alpha for the background view its affecting the pickerview and making that seethrough.

Anyone know how to do this?

Thanks


This sounds like your UIPickerView view and background view are inside the same view hierarchy. If you are setting the alpha on a view, all subviews will be effected by it. Ensure that your "background" view is really in the background and not the parent of the UIPickerView.

EDIT:

You should be able to create a hierarchy in IB like this:

 - UView (root view)
     - background view
         - children of the background view (optional)
     - picker view
         - children of the picker view (optional)
     - other view
         - children of the other views
             - grand children ... etc

In this scenario, the "background" and the other views at that level all have the same parent, so they are siblings.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜