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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:07:09+00:00 2026-06-15T01:07:09+00:00

I have created a shadow using QuartzCore for my UITextView with this following code.

  • 0

I have created a shadow using QuartzCore for my UITextView with this following code.

myTextView.layer.masksToBounds = NO;
myTextView.layer.shadowColor = [UIColor blackColor].CGColor;
myTextView.layer.shadowOpacity = 0.7f;
myTextView.layer.shadowOffset = CGSizeMake(2.0f, 2.0f);
myTextView.layer.shadowRadius = 8.0f;
myTextView.layer.shouldRasterize = YES;

It creates a shadow and looks good too. Here it is my output for the above code.

enter image description here

But When I try to add a text to the myTextView, my textView text goes out of the bounds and it looks outside of the myTextView like below.

enter image description here

It’s happening only when I add shadow. The text inside the textView is not showing weird If I don’t add shadow.What I am doing wrong?? How could I overcome this? Why it is happening?

UPDATE:

@borrrden said
I found It is happening, because of setting the maskToBounds = NO; If we set YES then we cannot get shadow. Reason Here it is an answer

  • 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-15T01:07:10+00:00Added an answer on June 15, 2026 at 1:07 am

    There is no “right” solution, because of UIView behavior. When masksToBounds is NO, any sublayers that extend outside the layer’s boundaries will be visible. And UITextField scroll text outside the UITextField layer.

    Add clear view behind the UITextView and drop a shadow on it.

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

Sidebar

Related Questions

Im using PHP code to create a dropshadow effect on images. I have this
I have created a Mac app and need to place a shadow behind the
I have created 3 classes as following Ext.mine.TextParent - Inherting from Textfield Ext.mine.child.TextChildA -
I have created an android application that calls (using kSOAP library) a SOAP based
I have this dropdown menu and I'm using CSS to highlight the items i'm
I'm making an Android app using Processing, and have decided to port my code
I created a MenuBar with collapsing sub-menus using Googles GWT like in this example:
I have created a simple application using MVC3 and the site is based on
I have added multiple ovals on map view by using below code but I
Hello I was wondering whether this is possible. I have a horizontal menu created

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.