• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
wits end with nsview and nsrectfill()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

wits end with nsview and nsrectfill()


  • Subject: wits end with nsview and nsrectfill()
  • From: Navneet Kumar <email@hidden>
  • Date: Sun, 30 Nov 2014 23:00:16 +0530

Hi,

I have a custom view in which I am setting the background using NSRectFill() in drawRect:. I am also adding a text field as subview in this method. The textfield is non-selectable, non-editable and is not set to draw background.

When the view comes to front, the background is same, but when it refreshes, the area apart from the text field becomes a bit darker and the text field area shows the original background, this creates a contrast which I want to get rid of.

The view is set to return YES to isOpaque.

I have tried a lot of things but to no avail.
I have tried CGContext approach to fill rect.
I also tried setting the color before NSRectFill() to a opaque color as well.

The problem is gone if I removeFromSuperview and create the custom view again and again on each drawRect: of the super view. But this consumes a lot of CPU.

An image showing the contrast is attached herewith.

Please help.

Best,
Navneet
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: wits end with nsview and nsrectfill()
      • From: Kyle Sluder <email@hidden>
    • Re: wits end with nsview and nsrectfill()
      • From: Steve Christensen <email@hidden>
    • Re: wits end with nsview and nsrectfill()
      • From: Mike Abdullah <email@hidden>
  • Prev by Date: Re: App fails on Yosemite - "Cannot remove an observer"
  • Next by Date: Re: wits end with nsview and nsrectfill()
  • Previous by thread: Re: App fails on Yosemite - "Cannot remove an observer"
  • Next by thread: Re: wits end with nsview and nsrectfill()
  • Index(es):
    • Date
    • Thread