English 中文(简体)
UIView 添加子视图间距
原标题:UIView add subview gap

我知道这也许是一个愚蠢的问题。但我正在设计一个 xcode 3, ios 5. 的单视图应用程序, 程序上添加一个子视图和图像视图, 以进入整个屏幕。 但是它显示在屏幕上我视野的底部有一个小缺口。 不知道为什么。 这是代码。 任何建议吗?

[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
homeView =[[UIView alloc] initWithFrame:self.view.frame];
UIImageView *backImage= [[UIImageView alloc] initWithFrame:self.view.frame];
backImage.image=[UIImage imageNamed:@"bg.png"];
[homeView addSubview:backImage];
[self.view addSubview:homeView];
问题回答

The gap was due to some transparent pixels in the image i was using. Nothing was wrong with the code. It has been resolved. Thanks





相关问题
Help with Open GL iPhone

I am trying to put an OpenGL View into my application but I want to make sure that before I do this that the view is transparent because I want to see and interact with the view behind it as well as ...

Image loads in simulator but not device?

In Interface Builder, I have a UIImageView in a nib and have selected an image from the View Attributes pane. The image loads fine in the simulator but not on my device in debug mode. I don t get ...

pixel value in UIImageView s image

I m trying to find the value of an pixel in the image displayed in an UIImageView. getting the pixel on the display is (relatively) simple. But when the image displayed is scaled (say the orgig. image ...

changing image dynamically in iPhone application

My problem is, I have table of names. And when I touch on each name, a new view should appear and image of corresponding name. For all the names only one view should be there and the image should ...

UIImageView - How to get the file name of the image assigned?

Is it possible to read the name of an UIImageView s UIImage that s presently stored in the UIImageView? I was hoping you could do something kind of like this, but haven t figured it out. NSString *...

UIImageView drifting on viewDidLoad

I am programmatically adding a UIImageView and a UILabel to multiple screens in a program I m working on. As such, I ve written a UIViewController that contains the code to load up the UIImageView ...

热门标签