cgrect Questions

5

Solved

I'm creating a comment section much like the one Facebook uses for it's messaging section in it's iOS app. I want the UITextView to resize the height so the text I'm typing fits inside it rather th...
Aversion asked 21/11, 2012 at 12:51

6

Solved

I want the bottom (not quite half) of my UIView to be a different color than the top. I'm wondering if I should create a CGRect and then color that? Is this along the right track? - (void)drawRec...
Photomural asked 5/8, 2013 at 17:27

2

Solved

This question is inspired by Andrew Carter's comment on a previous question about the new CGSize initializer in Swift. The Apple Docs for CGGeometry say: ... your applications should avoid dir...
Fief asked 24/2, 2016 at 17:12

4

How do you add a border around a UITextView (like a UITextField)? I want to allow users to type multiple lines, but unfortunately a UITextField does not support this. Is there an easy way to do thi...
Energumen asked 6/7, 2011 at 20:4

3

Solved

I have an implementation of AVCaptureSession and my goal is for the user to take a photo and only save the part of the image within the red square border, as shown below: AVCaptureSession's prev...
Tubuliflorous asked 9/1, 2014 at 4:36

1

Solved

As swift 3 says CGRectDivide is deprecated and the replacement is divided(atDistance: CGFloat, from fromEdge: CGRectEdge) -> (slice: CGRect, remainder: CGRect). As I know CGRectDivide was divid...
Ejector asked 19/9, 2016 at 5:10

2

Solved

What is the difference between CGSize and CGRect? As a beginner reading the CGGeometry Reference it wasn't immediately obvious, especially because there were references to size being a vector. I w...
Outherod asked 5/6, 2015 at 3:48

5

my requirement is generating a random point in a given area, i.e i have an Cg Rectangle of some space and I need to generate a random point in this rectangle .. how can I proceed in this scenario?...
Meaghan asked 1/11, 2013 at 5:29

1

Solved

I am using CGRect, CGPoint types in my project several times. I can nill the swift objects but i cant set nil values to C types. How can i free CGRect and CGPoint from swift?
Burgh asked 7/1, 2016 at 7:54

2

I'm trying to resize a UICollectionView height by setting it to 0 when the view controller is loaded, then increasing its size with an animation when a button is pressed. I've tried a few different...
Hellenist asked 22/10, 2012 at 18:32

2

Solved

HI I am making a game and need a spike at the bottom which I have decided to do via a UIView and collisions. I am coding in swift. I currently have a square: //Object Setup let square = UIView(...
Voracious asked 26/10, 2014 at 22:32

1

Both seem to work the same in Swift. Which should we use? CGRectZero vs CGRect.zeroRect GRectMake(1, 1, 1, 1) vs CGRect(x: 1, y: 1, width: 1, height: 1) UIEdgeInsetsMake(1, 1, 1, 1) vs UIEdgeInse...
Collative asked 2/5, 2015 at 3:4

1

Here is link on github https://github.com/spennyf/cropVid/tree/master to try it out your self and see what I am talking about it would take 1 minute to test. Thanks! I am taking a video with a squ...
Elyseelysee asked 4/4, 2015 at 19:3

2

Solved

I am new to Core Graphics and trying to understand why text labels I draw in CGRect form an elliptical arc when images I draw using the same coordinates form a circular arc. The original code by A...
Butacaine asked 27/1, 2015 at 7:32

2

I've tried to rotate my rectangle, but it does not work properly. Here is part of my code, I found it in another post: #define DEGREES_TO_RADIANS(x) (M_PI * x / 180.0) -(void)drawRect:(NSRect)rec...
Caesaria asked 10/9, 2013 at 4:51

1

Solved

I am using PaintCode and it has generated some code to create a shape with text overlayed. I want to use the code to parse a string and generate a UIImage that I can save to the camera roll or shar...
Pyrethrum asked 2/10, 2014 at 17:59

2

Solved

Which is better to use? I prefer CGRect.size.width cause it looks nicer. But, my colleague says CGRectGetWidth is better.
Nastassia asked 11/5, 2011 at 21:25

1

Solved

I can't find where I read it, but I remember coming across something that suggested it is better to access height of CGRects using CGRectGetHeight(rect) instead of accessing the variable via rect.s...
Ineffable asked 7/5, 2014 at 21:16

1

Solved

I am getting this error in my application when I run on an iPad: Uncaught exception: CALayer position contains NaN The same code works fine on an iPhone. - (void)mapView:(MKMapView *)mapView ...
Gerdy asked 8/4, 2014 at 11:27

1

Solved

I am trying to make a transition like APP Tinder. Detail: In Screen One there is a Vertical Rectangular UIImaveView with contentMode = Aspect Fill, so it hides some portion of Image to adujust Asp...
Flit asked 29/3, 2014 at 5:50

2

Solved

I am trying to find a recipe for producing a a blurred grayscale UIImage from a color PNG and alpha. There are recipes out there in ObjC but MonoTouch does not bind the CGRect functions so not sure...
Shroud asked 20/12, 2011 at 15:13

1

Solved

I have been using PaintCode to draw some of the graphics within my app, some of the drawn elements have text that is drawn using "drawInRect". The text is always showing up black regardless of what...
Heft asked 15/2, 2014 at 22:15

3

Solved

I have seen this alternative to using CGRectMake() in order to initialise a CGRect variable: CGRect frame = (CGRect){0,0,10,10}; My question is, how does CGRect frame = (CGRect){0,0,10,10}; w...
Ingold asked 7/8, 2012 at 8:45

4

Solved

I need to split a rectangle (A CGRect structure which is {{float x,float y},{float w,float h}}) into a number of smaller rectangles/structures, creating some sort of a grid. I'm writing a window la...
Padua asked 31/5, 2011 at 15:37

0

BEFORE READING "iOS 7 OMG DOWNVOTE" The problem has been solved and is not related to iOS 7 at all. The problem was that with autolayout turned on, you cannot change the frame directly but...
Stereochromy asked 16/6, 2013 at 5:15

© 2022 - 2024 — McMap. All rights reserved.