开发者

iphone-uiview-background

I am new to iPhone development. I have one XIB file, the login page (a form).

Now I want to set the UIView background image.

When I supply an image from Interface Builder then there is no effect, and when I set it from the code then also no effect.

self.view.backgroundColor = [UIColor colorWithPatternImage:
                                    [U开发者_如何学编程IImage imageNamed:@"srk_ipad_Homepg.png"]];

I don't want to use a UIImageView because when I place an image, all my controls are hidden behind the UIView.


You can use UIImageView to set a background without harm, you just have to move it to the top of the view hierarchy. Look at this splashscreen view:

iphone-uiview-background

And this is the view's hierarchy tree:

iphone-uiview-background

This will prevent your controls from being covered.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜