Configure a different IOS background for the button position _ios

Source: Internet
Author: User

Face full screen background picture, to put multiple buttons in a fixed position of the problem my solution, specifically as follows:

The picture is like this. Repeat the question: for example, I would like to place five buttons on the M U R P on the full screen background and five places to visit the official website, which requires a variety of phone models.

That's how I solved it (StoryBoard):

First: Drag 4 viewcontroller inside the storyboard, set the screen size to 3.5, 4.0, 4.7, 5.5, respectively.

Then set up the background picture separately, place the fixed button in the fixed place.

Then, when used, by judging different screen sizes to load different storyboard, the code is as follows: (Swift).

Copy Code code as follows:

Let ScreenHeight = Uiscreen.mainscreen (). bounds.size.height
var storyboards:uistoryboard = Uistoryboard (name: "Main", Bundle:nil) as Uistoryboard
if (ScreenHeight <=.) {
Viewcon = Storyboards.instantiateviewcontrollerwithidentifier ("A.") as! Firstviewcontroller
}else if (screenheight <=.) {
Viewcon = Storyboards.instantiateviewcontrollerwithidentifier ("A.") as! Firstviewcontroller
}else if (screenheight <=.) {
Viewcon = Storyboards.instantiateviewcontrollerwithidentifier ("A.") as! Firstviewcontroller
}else if (screenheight <=.) {
Viewcon = Storyboards.instantiateviewcontrollerwithidentifier ("A.") as! Firstviewcontroller
}
var Navicon:mainnavigationcontroller = Mainnavigationcontroller (Rootviewcontroller:viewcon)

The above content is for the button location configuration different iOS background introduction, I hope you like.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.