I used the following code to set a child UIView (a white box) inside of a UIView.
float x = 10.0;
float y = 40.0;
float w = self.view.frame.size.width - 20.0f;
float h = self.view.frame.size.height/3.0;
UIView *whiteBox = [[UIView alloc] initWithFrame:CGRectMake(x, y, w, h)];
Basically, I want to draw a white box with 10-pixel to the both margins of the parent UIView. However, The right side of the white box is always beyond the parent view's boundary. It looks like the self.view.frame.size.width is larger than the actual view's width. I am using the iphone5S as the simulator. I just want to know how I can set the correct width of the white box.