iPhone - Create a semi transparent rectangle with opaque text

前端 未结 1 1760
终归单人心
终归单人心 2020-12-09 21:42

I have a MapView and 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)

相关标签:
1条回答
  • 2020-12-09 22:02

    Can be easily done with interface builder:

    enter image description here

    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

    enter image description here

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

    enter image description here

    Settings for view "black translucent bg view"

    enter image description here

    0 讨论(0)
提交回复
热议问题