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

  • SEARCH
  • Home
  • 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 8871685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:03:07+00:00 2026-06-14T18:03:07+00:00

I am dynamically creating a (drawing my own custom) UIImage for the ‘UIImageView’ property

  • 0

I am dynamically creating a (drawing my own custom) UIImage for the ‘UIImageView’ property on a UITableViewCell.

When a user selects the tableView cell, the cell background turns blue but my custom UIImage background does not – it remains white (so it is painfully clear I’ve got an image sitting there). I’ve tried various drawing approaches

// when I create the cell
cell.imageView.backgroundColor = [UIColor clearColor];
cell.imageView.opaque = NO;

// 1. when I create the UIImage - clearColor background
CGContextSetFillColorWithColor(context, [UIColor clearColor].CGColor);
CGContextFillRect(context, rect);

// 2. when I create the UIImage - clear background
CGContextClearRect(context, rect);

but in both of these approaches, the background is black. The only thing that seems to work is to finishing creating the image and then apply create a 2nd image with ‘CGImageCreateWithMaskingColors’ based on the first image – masking out the background.

Is there a way I can “paint” a transparent background in the first place?

  • 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-06-14T18:03:08+00:00Added an answer on June 14, 2026 at 6:03 pm

    Make sure that you are passing NO to the opaque parameter of the UIGraphicsBeginImageContextWithOptions function when you setup the image context.

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

Sidebar

Related Questions

I am dynamically creating a table that contains a textbox in each cell. The
I am dynamically creating the columns for a data grid in a User control
I am dynamically creating 10 textinputs inside a vgroup . when user clicks a
I´m dynamically creating an instance of a class with reflection and this works fine,
I recently found that dynamically creating object and methods in Ruby is quite a
I am dynamically creating views as show below public class DynamicLayoutActivity extends Activity {
i am dynamically creating sql query for inserting multiple records in one hit.Suppose no
i am dynamically creating radio using jquery as shown belown. but they value only
I'm dynamically creating textfields in as3, and formatting them with the TextFormat class. I'm
I am dynamically creating a RadGrid and adding GridTemplateColumns to it. Those columns have

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.