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 8449149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:37:35+00:00 2026-06-10T10:37:35+00:00

I have a tableview where I customized the view cells and i want to

  • 0

I have a tableview where I customized the view cells and i want to draw the shadow on them. I have already use the view’s layer but if i draw the shadow by this way, my tableview is very very slow.
this is the code :

UIView  *foreground             = [[UIView alloc] initWithFrame:CGRectMake(8., 8., 305, 290.)];
foreground.tag                  = kForegroundTag;
foreground.backgroundColor      = [UIColor whiteColor];
/* Draw from here */
foreground.layer.shadowColor    = [UIColor blackColor].CGColor;
foreground.layer.shadowOpacity  = 0.7;
foreground.layer.shadowOffset   = CGSizeMake(0., 1.);
foreground.layer.shadowRadius   = 3.;

Thx you for help

  • 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-10T10:37:37+00:00Added an answer on June 10, 2026 at 10:37 am

    Drawing shadows using these properties can have poor performance. You have a couple of options though:

    You could set shouldRasterize on the layer to convert it to render the layer as a bitmap instead of redrawing (be careful: this is only useful if your view does not need to be redrawn often, and can end up being worse than the existing performance if used in the wrong scenario)

    The other option is to also use the shadowPath property on the layer. According to the CALayer docs:

    Specifying an explicit path usually improves rendering performance

    I would definitely use the shadowPath property, and depending on the nature of the view, possibly set the shouldRasterize flag as well

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

Sidebar

Related Questions

i have a tableView with 3 cells. i want to change .detailTextLabel of that
I have an array, I want to save this in UITable, but it is
I have a view controller with many views and a tableview. The tableview's cells
I have tableview, where create new rows and set them layout manually. In every
I have a TableView in a View, and when it scrolls, the rounded part
I have a tableview. I want to find the center of the UIImageView for
i have been trying to figure this out but i just can't.... for some
I have a tableview cell in a view which has some text in it,the
i have an customized cell that is loaded in table view cell and each
I have 2 classes for a UITableViewCell that show different data but they use

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.