Friday 15 August 2014

How to control what part of a UIView to update (iOS/Xamarin) - I need to prevent the screen from being fully erased -


I takes in a stream of'm working on a drawing application data and displays it turns out that UIView (too slow drawing a lot of line segments in the core graphics) I only by drawing a portion of the screen, I'm trying to speed it up with the new data

I currently screen ( Using this function of Xamarin / Monotouch)

  NSTimer.CreateRepeatingScheduledTimer (TimeSpan.FromSeconds (0.1), representatives {pane.SetNeedsDisplay ();});   

where pane is my UIView object pane object needs to know that reprinted the edge of the screen itself. I think there is another way that specifies the area of ​​the screen to be underlined - is this the right way? Or some other solution?

In addition, a group of code grids draws these never change there is a way to save them to some layer or something so that I can just add in the background?

Though the options to go along with Opening is not as good as drawing lines and I have to apply a lot of additional code to make it look perfect.

Thank you!

graph data, you own Uaiviyuu subclass' drawRect: method Core graphics should be used to present the lines. Ensure that the method only overlaps the data that overlaps with the CRGRTAR logic. Method > Need a redraw method, so instead of using the entire UIView mark as when changing your graph data, you should use the setNeedsDisplayInRect method of UIView: point to There is a new thing for that area of ​​UIView is the data that will call drawRect: , which will be re-created only if (if you implemented it correctly) )

About the background grid. , You can render a UIImage the grid, so to demonstrate that UIImage draws the graph behind the scenes. , UIGraphicsGetImageFromCurrentImageContext , and UIGraphicsEndImageContext : You UIGraphicsBeginImageContext , I want to see the documentation for the CALayer renderInContext.

No comments:

Post a Comment