100% opacity uilabel over a 50% opacity background (uiview ?) Uiview is 100% transparent, and the above uilable is transparent

Source: Internet
Author: User

So right now I have a uiview with a uilabel in it. I want the background to have an opacity <1.0 and the label to have an opacity of 1.0. however since Alphas propagate down the view hierarchy, the label ends up with an opacity <1.0 as well.

Is there anyway to do what I want without making the uilabel A subview of another view ??

 

Just set the background color to be semitransparent:

View. backgroundcolor = [[uicolor blackcolor] colorwithalphacomponent: 0.5f];

 

100% opacity uilabel over a 50% opacity background (uiview ?) Uiview is 100% transparent, and the above uilable is transparent

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.