¡@

Home 

2014/10/15 ¤U¤È 10:13:59

iphone Programming Glossary: setneedsdisplayinrect

setNeedsLayout and setNeedsDisplay

http://stackoverflow.com/questions/14506968/setneedslayout-and-setneedsdisplay

How to erase piece of UIImageView with png-brush and UIBezierPath

http://stackoverflow.com/questions/17674311/how-to-erase-piece-of-uiimageview-with-png-brush-and-uibezierpath

a png picture with soft edge to make piece of the second image visible. I did that by this way 1 touchesMoved and self setNeedsDisplayInRect self brushRectForPoint touch_location 2 at void drawRect CGRect rect I call _brush drawAtPoint touch_location blendMode..

Drawing incrementally in a UIView (iPhone)

http://stackoverflow.com/questions/1798414/drawing-incrementally-in-a-uiview-iphone

point if myPoints count kMaxPoints Drop drop Drop alloc init autorelease drop.point point myPoints addObject drop self setNeedsDisplayInRect CGRectMake drop.point.x drop.dropSize 2 drop.point.y drop.dropSize 2 drop.dropSize drop.dropSize redraw void drawRect CGRect.. the content of the UIView every single time you can mark only the areas of the view that need redrawing using UIView setNeedsDisplayInRect instead of UIView setNeedsDisplay . You also need to make sure that the graphics content is not cleared before drawing by..

Implementing iphone's copy/paste controls on a custom view / uiview subclass

http://stackoverflow.com/questions/2110731/implementing-iphones-copy-paste-controls-on-a-custom-view-uiview-subclass

work on my simulator and goes like this CGRect drawRect self rectFromOrigin currentSelection inset TILE_INSET self setNeedsDisplayInRect drawRect UIMenuController theMenu UIMenuController sharedMenuController theMenu setTargetRect drawRect inView self theMenu.. animated YES There are a few differences here drawRect is calculated from a giant view tile and tap point calculations setNeedsDisplayInRect is being called self is a large screen sized view you may need screen coords instead of local coords you can probably get..

Disabling implicit animations in -[CALayer setNeedsDisplayInRect:]

http://stackoverflow.com/questions/2244147/disabling-implicit-animations-in-calayer-setneedsdisplayinrect

implicit animations in CALayer setNeedsDisplayInRect I've got a layer with some complex drawing code in its drawInContext method. I'm trying to minimize the amount of drawing.. drawing code in its drawInContext method. I'm trying to minimize the amount of drawing I need to do so I'm using setNeedsDisplayInRect to update just the changed parts. This is working splendidly. However when the graphics system updates my layer it's transitioning.. to zero and neither work. Here's the code I'm using CATransaction begin CATransaction setDisableActions YES self setNeedsDisplayInRect rect CATransaction commit Is there a different method on CATransaction I should use instead I also tried setValue forKey..

iOS: how to change the size of the UIScrollView content?

http://stackoverflow.com/questions/5464550/ios-how-to-change-the-size-of-the-uiscrollview-content

setNeedsDisplay marks the entire view as needing display. To cause it to display only the visible part you need to use setNeedsDisplayInRect visibleRect . Assuming the view is at the top left corner its frame's origin is 0 and the scroll view does not allow zooming..

How to reload my UIViewController on click of some buttons?

http://stackoverflow.com/questions/7725215/how-to-reload-my-uiviewcontroller-on-click-of-some-buttons

this question The easiest way to get a view to re draw itself is to call UIView setNeedsDisplay or by using UIView setNeedsDisplayInRect . This method tells the view that it needs to re draw itself and it's subviews. However you shouldn't always have to call..

Creating a custom text-drawing view

http://stackoverflow.com/questions/844829/creating-a-custom-text-drawing-view

the line being edited but sometimes the lines below as well e.g. if you press return halfway through the document with setNeedsDisplayInRect . This makes word wrap complicated because then you have to draw more than one line on the screen even though it still is..

calling drawRect in a UIView subclass

http://stackoverflow.com/questions/9407162/calling-drawrect-in-a-uiview-subclass

setNeedsDisplay If you need to customize the drawing area aka the CGRect that will be passed to drawRect you can use setNeedsDisplayInRect As @rob mayoff has suggested you can override the setter for the point_ property void setPoint_ CGPoint point if CGPointEqualToPoint..