Questions tagged [cgrectmake]

CGRectMake is used in iOS, it returns a rectangle with the specified coordinate and size values.

CGRectMake is used in iOS (), it returns a rectangle with the specified coordinate and size values.

CGRect CGRectMake (
  CGFloat x,
  CGFloat y,
  CGFloat width,
  CGFloat height
);
  • x: The x-coordinate of the rectangle’s origin point.
  • y: The y-coordinate of the rectangle’s origin point.
  • width: The width of the rectangle.
  • height: The height of the rectangle.
153 questions
0
votes
1 answer

CGRectMake Revert back to original position?

Im moving a UIView from its original position as laid out on my XIB/Storyboard using the following: -(void)myMovingViewAction{ [UIView animateWithDuration:.15 animations:^{ [theView setFrame:CGRectMake(0,…
user1736431
  • 81
  • 1
  • 5
0
votes
0 answers

Change UITextField size programmatically

I have a UITextField in my storyboard, which I bind to the ViewController.h with @property (weak, nonatomic) IBOutlet UITextField *username; In the ViewController.m I want to change the size and position of this UITextField username [_username…
0
votes
1 answer

iPhone SDK create custom shaped UIView by cropping the UIView

I am trying to create a custom shape for a UIView, named 'CoverView'. Currently I have the frame set to... [CoverView setFrame:CGRectMake(0, 0, 1808, 303)]; I wanted to create a custom shape for the UIView to have a 200x200 cut out from the top…
OscarTheGrouch
  • 2,374
  • 4
  • 28
  • 39
0
votes
1 answer

How can I set my UIView's frame from CGRectMake?

I am new to iOS development, but have had an extensive crash course recently (BNR guid to iOS Programming). I am working on modally adding views to an app. I currently do not have a View Controller, so my AppDelegate's…
Phil
  • 35,852
  • 23
  • 123
  • 164
0
votes
1 answer

how to find last view width in ipad

i am adding view in mainview. how to find last inserted view width? NSArray *noPotions = [NSArray arrayWithObjects:@"1",@"2",@"3",@"4", nil]; int list = [noPotions count]; int lastPosition = 10; int widthValue = 100; for (int i = 0; i < list ;…
sreenivas
  • 399
  • 2
  • 5
  • 20
0
votes
1 answer

difference between CGRectMake and setContentSize scrollVew

what is the difference between this two instruction scrollView.frame=CGRectMake(0, -100, 960, 100); [scrollView setContentSize:CGSizeMake(960, 100)];
0
votes
2 answers

Images in UIAlertView: CGRectMake in retina and non-retina iPhone

I am working on an app where I show in UIAlertView some icons appear in order to explan theirs use. I did that using: UIAlertView *helpAlert = [[UIAlertView alloc] initWithTitle:@"The button:\n\n is used to do... \n\n " message:@"" delegate:self…
doxsi
  • 1,002
  • 19
  • 42
0
votes
1 answer

CGContextRef unit conversion

Some month ago I created a PDF Creator using FPDF (PHP Class). Now I was using NSData to fetch the PDF data from a URL into a UIWebView. Because I'm implementing offline functionalities into my app I want to convert the FPDF PHP Script into cocoa…
Julian F. Weinert
  • 7,474
  • 7
  • 59
  • 107
0
votes
1 answer

How to Get button position regarding to the window

I have scrollView in which there are 12 buttons. On window only four buttons are visible at a time. For animation purpose I need button's position regarding to the window. I had followed these methods but its not working for me: [btn.superview…
Dhanesh
  • 93
  • 1
  • 11
0
votes
1 answer

Custom UIProgressView drawing weirdness

I am trying to create my own custom UIProgressView by subclassing it and then overwrite the drawRect function. Everything works as expected except the progress filling bar. I can't get the height and image right. The images are both in Retina…
Saeverix
  • 397
  • 5
  • 18
0
votes
2 answers

find minimum values in CGFloat obtained in a loop

I am drawing reactangles in a loop based on the parameters that I get from the looping variable event as below : CGRectMake(cellWidth * event.xOffset,(cellHeight / MINUTES_IN_TWO_HOURS * [event minutesSinceEvent]), cellWidth,cellHeight /…
0
votes
3 answers

Getting an exception from CGRectMake when running on iOS device (but not simulator)

I have an exception happening that I just can't figure out. I have this bit of code here: newControllers = [[NSMutableArray alloc] initWithCapacity:9]; // Only allocate what we need // Ok, add the new thumb UIs for (int i = 0; i < 3; ++i)…
Jason
  • 5,277
  • 4
  • 17
  • 12
0
votes
2 answers

Why am not getting collision detection with CGRectIntersectsRect in IOS?

I have 4 elements: greenball, yellowball, orangeball, and redball that fall from the top of the screen I also have an element, blueball, that follows my touch. All of these things are working great! :D However, I want to detect when the greenball…
dcp3450
  • 10,959
  • 23
  • 58
  • 110
-1
votes
2 answers

CGRectContainsPoint fails to reach the boundaries

//Test code to print all coordinates CGRect b=CGRectMake(0, 0, 4, 3); //top left float topLX=CGRectGetMinX(b); float topLY=CGRectGetMinY(b); NSLog(@"(%f,%f)",topLX,topLY); //top right float topRX=CGRectGetMaxX(b); float…
-1
votes
2 answers

Move CGRect to the bottom of the screen

I am running AdMob on my app, but the tutorial provided by google has the banner on top of the app, i want it at the bottom of the app/screen, i use rows 0 to 17, so anything after row 18 is fine. This is the method that draws the ad if one was…
user3396301
  • 101
  • 1
  • 3
  • 8
1 2 3
10
11