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

iOS ordering behaviors in viewDidLoad

In the viewDidLoad, I have an initial setup like this - // Output all the appropriate text to UITextLabel depending on the state of the app [self presentData]; // Button sizing UIelement.frame=CGRectMake(blah blah blah); Why is it that when I do…
Michael Kimin Choo
  • 165
  • 1
  • 4
  • 10
0
votes
0 answers

CGRectmake would mess up with the y and height values

Here is the problem. I have searched and tried in the past few days and staring at those few lines of code with no luck. Any help would be appreciated! I am trying to zoom with a pinch gesture and it works fine until I rotate it first, then pich to…
0
votes
1 answer

Unable to center a imageView in a tableView Footer

I am trying to center a label and an image in a tableView Footer I can't seem to make it work for both device iPhone and iPad Right now it is centered on the iPhone but that's because I hardcoded it. -(UIView *)tableView:(UITableView *)tableView…
0
votes
2 answers

put UIButtons at random position

How to put 4 UIButtons at 4 random positions only. I have an app that has 4 UIButtons every time I press an change position button the UIButtons should change there position like Button1 moves to the position of Button4 and Button4 to any other…
user2776957
  • 25
  • 1
  • 8
0
votes
2 answers

Combining Multiple UI Images and UI Labels into 1 Image

Basically I have a main UIImage, which acts as a background/border. Within that UIImage I have 2 more UIImages, vertically split with a gap around them so you can still see a border of the main background UIImage. On each side I have a UILabel, to…
0
votes
2 answers

Convert float value to double in objective c

I have use the cast to convert a string to int, a string to double and it works. Now I want to convert a float value to double and xcode tell me: "Pointer cannot be cast to type 'double'", My float variable is declared in .h @property float…
user2958588
  • 13
  • 1
  • 6
0
votes
1 answer

Put shadow to a rectangle (drawRect:(CGRect)rect)

I did a rectangle with this code and it works: - (void)drawRect:(CGRect)rect{ CGContextRef context = UIGraphicsGetCurrentContext(); CGContextAddRect(context, CGRectMake(60, 60, 100, 1)); CGContextStrokePath(context); } But now i want to…
user2958588
  • 13
  • 1
  • 6
0
votes
1 answer

Changing subviews frames dynamically in iOS app

I have a view whose subviews' frames I need to be dynamically change in response to user actions. When the view is loaded, I initialize its subviews like this: if (self.firstSubview == nil) { NSArray* views = [[NSBundle mainBundle]…
AppsDev
  • 12,319
  • 23
  • 93
  • 186
0
votes
1 answer

UIWebView Resize CGRektMake

A few weeks ago i started a "xcode" project in which i had to resize a UIWebView. I did this with webView.frame = CGRectMake(0, 118, 320, 410); It worked perfectly, no issues. Then, yesterday i started a new project and i wanted to do the same…
0
votes
2 answers

Distinguish between iPhone 4 and 5 to set height of UITableView

I want to check if the users device is an iPhone 4 or 5 and then set the height of a tableView. The xCode simulator recognizes that it is an iPhone 4 the message 'iPhone 4' is shown, but the height of the tableView stays the same. What am I doing…
user3298017
  • 31
  • 1
  • 6
0
votes
1 answer

UILabel and UITableView CGrectMake reframing - iPhone

I have a NavigationControllers A and a UIViewController B . A has a label and below that is the UITableView. When navigate from A to B and navigate back from B to A, I have my label and table view reframed. I have tried setting the frame through…
Sharanya K M
  • 1,805
  • 4
  • 23
  • 44
0
votes
2 answers

How to give height from bottom instead of top

I have textview to display some content. I know CGRectMake(10,50,100,100). The 50 is reduce from Top Margin. I need to reduce the from bottom of 50. Where to change the code?
user3073276
  • 74
  • 1
  • 2
  • 13
0
votes
1 answer

CGRectMake Coordinates

I ran into a weird problem where the coordinates I am using for CGRectMake function do not seem to be correct. For example: CGRect screenR = [[UIScreen mainScreen]bounds]; sWidth = screenR.size.width; sHeight = screenR.size.height; button.frame =…
Amendale
  • 317
  • 3
  • 19
0
votes
1 answer

Moving buttons during viewDidLoad

I want to move a few buttons when the view loads when I check for 4inch or 3.5 inch screen but it doesn't do anything! Why doesn't this line of code work? Even with self. it doesn't work by the way. - (void)viewDidLoad { CGRect…
4GetFullOf
  • 1,738
  • 4
  • 22
  • 47
0
votes
2 answers

Custom UIView size position and IBaction

Good evening , I'm working on app that has to show (when a button is clicked) a custom container in a precise position and size over my ViewController. This container will load 2 checkboxs (I know that I can use a UISwitchControl and modify the 2…
moujib
  • 742
  • 2
  • 7
  • 26