简体   繁体   中英

iPhone Setting A Background Image

I want to use an image as a background for my application. I want the buttons to be over the image. How is this accomplished? Everytime I use image view it covers up the buttons.

The image view should cover your buttons unless you are placing it higher in the list of subviews. Make sure your image view subview is added first and the buttons (and all other views) will be displayed on top of it. Are you doing this in Interface Builder or manually in code?

You could try using UIView's sendSubviewToBack method:

UIImageView view = / init view */;
// some additional code here
mainView.addSubview(view);
// add buttons, etc...
mainView.sendSubviewToBack(view);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM