开发者

iphone-uiview-background

开发者 https://www.devze.com 2023-03-04 13:14 出处:网络
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.

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

精彩评论

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