drawrect Questions
2
Solved
There are two drawRect methods:
- (void)drawRect:(CGRect)rect
{
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSaveGState(context);
// do drawing here
CGContextRestoreGState(co...
Sewel asked 19/3, 2013 at 17:1
2
Solved
I am trying to draw colored text in my UIView subclass. Right now I am using the Single View app template (for testing). There are no modifications except the drawRect: method.
The text is drawn b...
Surrejoinder asked 15/12, 2012 at 16:54
3
Solved
I currently have an NSView that draws a grid pattern (essentially a guide of horizontal and vertical lines) with the idea being that a user can change the spacing of the grid and the color of the g...
Maculation asked 26/4, 2010 at 22:27
5
Solved
I need to draw lots of polygons 500k to a million on the iPad. After experimenting, I can only get only get 1 fps if that. This is just an example my real code has some good sized polygons.
Here a...
Refutation asked 20/5, 2011 at 8:4
3
Calling all experts! I have seen various posts, and to be honest, my need is a little different than the answers available on SO.
I want to create a UI where the user can create various lines (st...
Yarborough asked 31/8, 2015 at 9:46
5
Solved
With the code below I am drawing a rounded rectangle. It draws a nice solid light gray filled rounded rectangle (at the size of "self"). I actually want to draw the pixel inverse of this, that is: ...
Lowell asked 3/1, 2013 at 14:44
2
Solved
In my drawRect method, I am drawing a PNG image. On top of that, I want to draw a rect with a 20% alpha color, like this:
[[UIColor colorWithWhite:0.0 alpha:0.2] set];
UIRectFill(rect);
The prob...
Overabundance asked 29/5, 2010 at 15:23
4
Solved
I would like to check if my custom NSButton is currently in a pressed state (the user is clicking down on it) in my custom drawRect method. Something like this:
- (void)drawRect:(NSRect)dirtyRect{...
Bondage asked 22/2, 2013 at 4:48
2
Solved
I'm new to learning Swift, and am trying to get an incredibly simple app to run. All I'm trying to do is get UIView.drawRect to update when I press a button. It updates/draws when the app first loa...
0
I need help to better understand how CADisplayLink and drawRect behave, so that I can figure out how to keep my app's framerate at a smooth 60fps. My (presumably incorrect) understanding so far is ...
Foilsman asked 10/12, 2014 at 8:44
1
I'm converting a view from shocks and struts to autolayout but now the custom drawing code that is in drawRect is not being called. Is this expected behavior and if so how can I work around this?
Panegyric asked 19/10, 2013 at 3:29
1
Solved
The new ios 7 phone app has a favorites section. In that section the names of the contact appear next to a filled in circle with the inital of the contact inside the circle.
How is this drawn? Wit...
Extinguisher asked 29/10, 2013 at 6:59
2
Solved
My problem is this: I have dynamic content in an iOS app (such as twits - although this is not a twitter app) that include both text and images (mostly icons/emoticons and thumbnails). I want to re...
Unready asked 16/5, 2013 at 11:25
2
Solved
I am using a subclass of UIView to draw, this subclassed view is used to get your signature on a view controller. There is a clear button which is supposed to clear the UIView except it doesn't wor...
Naquin asked 20/11, 2013 at 5:13
2
Solved
I would like to have a UIView subclass that implements a method similar to setNeedsDisplay, except that redrawing (i.e., that would usually be called via drawRect:) will occur in a background threa...
Specious asked 15/1, 2014 at 13:54
2
Solved
I am trying to create the circles below in my iOS app. I know how to make the circles but am not entirely sure on how to get the points along the arc. It has to be in code not an image. Below is al...
Bridgettebridgewater asked 5/3, 2013 at 22:22
3
Solved
I'm working on an photo app where you can draw lines on an photo.
The background is the photo, and via drawrect I draw lines on a subview.
Every thing works but how can I erase lines on a subview ...
Slope asked 19/5, 2012 at 15:24
1
Solved
I followed a tutorial online to draw in a subclassed UIView. The tutorial showed a UIView with a white background, I fixed this by simply changing the super's bg color. The problem is, when touches...
Myall asked 24/10, 2013 at 2:34
3
Solved
I created a container view that holds a bunch of child views - a collection view, a custom toolbar and some bits and pieces.
The design has a border on the top, left and right sides, but not the ...
Enclasp asked 21/10, 2013 at 15:14
2
There is a UIView subclass (ThumbView) inside a UICollectionViewCell. The following code works great in iOS 7 simulator:
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView...
Ellamaeellan asked 17/9, 2013 at 6:28
4
Solved
Like so:
I know that this will not work with NSShadow, drawing it in drawRect: will work just fine.
Lucarne asked 7/9, 2013 at 18:41
1
Solved
Basically I need to have a circle with stroke in different color, all equal in size. For example, 1/2 is blue and 1/2 is red. Image (sorry for so bad image):
How can I draw something like this?
...
Broomstick asked 23/8, 2013 at 13:30
1
I am drawing annotations on a view. The line annotation is causing a problem;
I have a parent class of Shape (extended from UIView). All the annotations are subclass of shape. In each annotation c...
Alastair asked 14/8, 2013 at 10:47
2
Solved
I want to draw a very thin hairline width of a line in my UIView's drawRect method. The line I see that has a value 0.5 for CGContextSetLineWidth doesn't match the same 1.0 width value that is used...
Ex asked 14/10, 2012 at 2:21
3
Solved
I have a couple of UIView classes all drawing the same thing but in different colors and alpha settings. I've tried to pass parameters but cannot figure out how to get the drawRect part where I nee...
© 2022 - 2024 — McMap. All rights reserved.