Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6123717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:02:58+00:00 2026-05-23T16:02:58+00:00

I have a UIView has some labels and buttons on it. Next I also

  • 0

I have a UIView has some labels and buttons on it.

Next I also have a image which has a square area that is transparent, now
if I create a UIImageView and add this image which has transparent regions I am not able to see the background view (which has buttons and labels) through this transparent image.

If I play with the alpha value that doesn’t work as intended which is to see the transparent regions exactly as it would have appeared on the UIView which has the labels and buttons.

UIImage* image = [UIImage imageNamed:@"TI1.jpg"];
UIImageView* imageView = [[UIImageView alloc] initWithImage:image];
[self.view addSubview:imageView];

Also I would be interested to know if there is other way to achieve what I am trying to achieve.

Basically I want to highlight a certain area of the view which has buttons/labels and make the rest of the area greyed out. My idea was to have this UIImageView with transparent regions in image to achieve that.

Thanks
Ankur

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T16:02:58+00:00Added an answer on May 23, 2026 at 4:02 pm

    Try setting imageView.opaque = NO;

    UIImageView inherits from UIView. According to that class’s docs:

    This property provides a hint to the drawing system as to how it
    should treat the view. If set to YES, the drawing system treats the
    view as fully opaque, which allows the drawing system to optimize some
    drawing operations and improve performance. If set to NO, the drawing
    system composites the view normally with other content. The default
    value of this property is YES.

    Also, not sure that JPG even supports transparency, so try exporting the image as a PNG to ensure you get the results you’re looking for.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UIView that has an image and some buttons as its subviews.
I have a UIView which contains some controls (e.g. buttons, labels, etc). I overlay
Suppose I have a UIView that has some buttons and stuff, and I want
I have created a custom UIView that has some set of UILabels in it.
I want to have a UIView subclass that has a border image, but I
I have a class that inherits from UIView, and this class has some controls
I have a UITableViewController which has a UIView* called errorView that is used to
I have a view based application which has some textboxes that I'm trying to
I have a UIView that has several UIImageViews as subviews. Each of these subviews
I have a UIView container that has two UIImageView s inside it, one partially

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.