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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:45:20+00:00 2026-05-28T01:45:20+00:00

In a magazin I read about some nice extensions for the UIView class. You

  • 0

In a magazin I read about some nice extensions for the UIView class. You will be able to add a border with corner radian or a drop shadow to any UIView.

@implementation UIView (Extentions)

-(void) enableRoundRectsWithValue:(float)value
{
    self.layer.masksToBounds = true;
    self.layer.cornerRadius = value;
}

-(void) enableShadow
{
    self.layer.masksToBounds = false;
    self.layer.shadowOffset = CGSizeMake(0,2);
    self.layer.shadowOpacity = 0.5;
}
@end

While these methods work fine for themselves they don’t play nice together. I can’t have a corner radius and a shadow. At least not like you expect them to be. I guess because masksToBounds is set to true in one method and false in the other.

How can I get a UIView with a corner radius and also a shadow (with the same corner radius)?

  • 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-28T01:45:20+00:00Added an answer on May 28, 2026 at 1:45 am

    It’s kind of old but more people with the same problem can get here looking for a solution.

    I guess this post can help. It explains a little about CALayer and about mixing effects, including corner radius and shadows.

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

Sidebar

Related Questions

I read some articles in MSDN magazine about new features in ASP.NET AJAX 4.0
I was reading an article on MSDN Magazine about using the Enumerable class in
In some articles people mention explicit run sxs. Is it actually possible? I've read
i have a query to read magazine from db as $select = $db->select() ->from('tbl_magazine',array('magazine_id','magazine_name'))
I am reading an article in IEEE Computer magazine about using data mining on
It seems that I've finally got to implement some sort of threading into my
I recently read in a magazine that there is a new commercial developer tool
So I've read a few magazine articles and the website for Gimpel's PC-lint and
Background: I am aware of this SO question about Transactional NTFS (TxF) and this
I am creating an Android app that will download and cache PDF files (the

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.