开发者

iPhone - Create a semi transparent rectangle with opaque text

开发者 https://www.devze.com 2023-03-01 08:57 出处:网络
I have a MapView an开发者_Python百科d I want to display a black semi transparent rectangle on top with a text inside. Not over the entire map only on section of it (maybe on the top corner) just as an

I have a MapView an开发者_Python百科d I want to display a black semi transparent rectangle on top with a text inside. Not over the entire map only on section of it (maybe on the top corner) just as an info box (like the one in the iPod player that appears on double tap and displays the Mute and skip buttons).

I tried google but I'm not getting any clear answers. How is the best way to accomplish this?

Thanks in advance


Can be easily done with interface builder:

iPhone - Create a semi transparent rectangle with opaque text

View Hierarchy

NOTE The background has to be a separate view which is the first entry in the list of controls, so it is in the background. Setting the container view to an alpha value below 1 will also be inherited by the subviews, which is not displayed in the interface builder

iPhone - Create a semi transparent rectangle with opaque text

Settings for view "view with clear color bg and alpha 1.0"

iPhone - Create a semi transparent rectangle with opaque text

Settings for view "black translucent bg view"

iPhone - Create a semi transparent rectangle with opaque text

0

精彩评论

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