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

Buttons not in proper frames when loading from a different orientation in iOS7

I have a view with two buttons that serve as segues to other views. Autolayout is disabled and I have set the frames for the buttons in portrait and landscape programatically via CGRectMake. When I navigate to the view containing the buttons, they…
Garmash
  • 27
  • 5
0
votes
1 answer

xcode 4 drawing rectangles

i'm very new to xcode. i've googled this and even serched here and i didn't find exactly what i was looking for. i really wanna get this. especially since it's the most basic thing there is. so, i have the .h and .m files i want to DRAG a uiview…
0
votes
1 answer

Memory Leaks for CGRectMake and crashes in devices

I am using ARC in my project and it crashes when i run the app in devices so i checked command+shift+B its showing the following leak.... Below is the code which i have used, -(UITableViewCell *)tableView:(UITableView *)tableView…
Nithinbemitk
  • 2,710
  • 4
  • 24
  • 27
0
votes
1 answer

Scaling CALayer up from bottom. (Not top)

I have stumbled upon a problem that really shouldn't be too hard to figure out. However, after a lot of trial and error I have still not fount a solution. I have a CALayer created with CGRectMake(20, 20, 40, 40). I now want to scale this layer…
fisher
  • 1,286
  • 16
  • 29
0
votes
1 answer

Cocos2d: Testing for collisions, says that the two sprites always intersect

Hello I am making a cocos2d side scroller. I am trying to test for collisions between two sprites. I checked and the rects I am making for the sprites are what they are supposed to be, but it says that the two rects intersect all of the time whether…
0
votes
3 answers

Move multiple objects at once - iOS

I have a view with about 10 objects on it, and I have set all individual tags for them. I would like to move them all up by 20 points so their original Y position minus 20, using a for loop and iterating through each tag. I know I can do something…
FidelCashflo
  • 513
  • 2
  • 10
  • 23
0
votes
1 answer

Arrow on popViewController not going where I tell it

I have a UIPickerController that appears when you click a button though the arrow on it doesn't change position from the bottom even when I use UIPopoverArrowDirectionUp. - (IBAction)addPicture:(id)sender { CGRect rect =…
0
votes
2 answers

Core Graphics won't load all the way for certain buttons

I am coding a button background of a simple red gradient, which works when the height is less than 100, but will simply stop loading the gradient if the button is larger than that and I can't figure out why. I am using PaintCode (which up until now…
cory ginsberg
  • 2,907
  • 6
  • 25
  • 37
0
votes
1 answer

Using CGRECTMAKE what is the ratio to convert an iPhone 4 ..rect to an iphone 4s rect Xcode

I have used CGRECTMAKE to position an image onto the 'camera' screen and was wondering whether there is a calculation ratio to convert a 4 image placement to a 4s Iphone 4 screen is 320 480 iphone 4s screen is 640 960 I have tried just doubling my…
clive dancey
  • 143
  • 11
0
votes
1 answer

making a CGRect off screen

Is it possible to create UIImageView within a CGRect offscreen? I will then animate it onto the screen after a user pushes a UIButton. I know this function CGRectMake(x,y,height, width) but apparently x and y cannot have negative values. Can…
bf613
  • 3
  • 1
0
votes
3 answers

How to change the frame of a view when a variable value changes?

In my viewcontroller, there are few views. All of that view's frames are depends on the variable CGFloat borderWidth These views are defined like sec1 = [[MSSectionView alloc]initWithFrame:CGRectMake(self.borderWidth,…
manujmv
  • 6,450
  • 1
  • 22
  • 35
0
votes
1 answer

uibutton setframe not working no auto layaout enabled

I have an uibutton which i want to change its position depending on the device however this code: [self.notification setFrame:CGRectMake(12, 495, 17, 18)]; does not work at all! No auto layout enabled. Any thoughts? Any help appreciated.
stefanosn
  • 3,264
  • 10
  • 53
  • 79
0
votes
4 answers

UITabBarController display

I am newbie in iOS development. I am developing an application that is using tab bar controller. I am setting frame for tab bar controller programmatically but when I switch to iPhone 5 there is white space created between tab bar items and the main…
Shital Tiwari
  • 175
  • 2
  • 3
  • 17
0
votes
1 answer

How to set bounds of actionSheet imageView?

I need to change the bounds of imageView property on ActionSheet, #pragma UIActionSheetDelegate Methods - (void)willPresentActionSheet:(UIActionSheet *)actionSheet { /*[[[actionSheet…
0
votes
2 answers

Trying to position a button programmatically, however not in right position according to X,Y

I'm trying to position a button. Here is the code for the positioning.. [btnAbs setFrame:CGRectMake(57, 50, 106, 99)]; The coordinates I got are from here: As you can see the xib stats the x & y to be at 57 and 192, which is where I want the…
John Kee
  • 45
  • 1
  • 3
  • 10