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

The Archive Base Latest Questions

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

Consider a view with a custom background that is drawn in drawRect: . If

  • 0

Consider a view with a custom background that is drawn in drawRect:. If the view changes size, the background need to be redrawn.

Is this a bad idea?

- (void) layoutSubviews
{
    [super layoutSubviews];
    [self setNeedsDisplay];
}

If it is, what would be a better alternative considering I can’t control who changes the size of the view?

  • 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-14T11:03:15+00:00Added an answer on June 14, 2026 at 11:03 am

    Dont do that, it’s not necessary. Set the contentMode of the view to UIViewContentModeRedraw:

    UIViewContentModeRedraw

    Redisplays the view when the bounds change by invoking the setNeedsDisplay method.
    Available in iOS 2.0 and later.
    Declared in UIView.h.

    This will achieve the same effect.

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

Sidebar

Related Questions

I am trying to accomplish this: Consider a table view with Search Bar on
Consider a View that defines a list of objects: App.ListView = Ember.View({ items: 'App.FooController.content'
consider table sales (id, seller_id, amount, date) and here is a view that is
Consider this Django view which will get a list of items associated to the
Consider a ViewModel and a View that uses it, where the DataContext is set
Consider this simplified view of some code with which I'm working: @Stateless(...) @Remote(...) @TransactionAttribute(TransactionAttributeType.MANDATORY)
Consider this simple UIView subclass in an ARC-enabled iOS app that draws on the
Consider a view with a button. We can drag a connection from this button
I have a question about views. Consider we have a view that I insert
consider this sql CREATE VIEW [dbo].[MyView1] ([ID],[VisitDate],[StartDate] ,[EndDate],[MyCount]) WITH SCHEMABINDING AS SELECT id, VisitDate,dateadd(dd,-10,VisitDate),dateadd(dd,10,VisitDate),

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.