Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to add views to the iOS11 application editing interface in iOS11 development

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces how to add views to the iOS11 application editing interface in iOS11 development, which is very detailed and has a certain reference value. Interested friends must finish reading it!

There are two ways to add views in iOS: one is to add views using the editing interface, and the other is to add views using code. The following is a detailed description of these two ways.

1. Edit interface to add view

Adding a view using the editing interface is a fairly simple task by dragging the view from the view library to the main view.

[example 1-1] the following will implement how to add a blank view using the editing interface. The specific steps are as follows:

(1) create a project of type Single View App template, named UIVIew-InterfaceBuilder.

(2) Open the Main.storyboard file, click Show the Object library, find the View view in the displayed view library, that is, the blank view, and drag it to the main view of the canvas, as shown in figure 1.46.

Figure 1.46 add View

When you run the program at this point, you will see the effect shown in figure 1.47.

Figure 1.47 running effect

Because the default background color of the View blank view added using the editing interface is white, you can't see the effect on the simulator. So how do you see the added blank view of View on the simulator? The developer needs to go back to the Main.storyboard file and select the blank view of View that was added to the main view. Then, select in the property inspector panel to open the appropriate property settings, find the Background property and set it to Dark Gray Color, as shown in figure 1.48.

Figure 1.48 setting the background color

When you run the program at this point, you will see the effect shown in figure 1.49.

Figure 1.49 running effect

Note: some properties are stored in the property inspector panel, and when the developer clicks a view in the main view, the corresponding property settings appear in the property inspector panel, and developers can beautify the view through these properties.

These are all the contents of the article "how to add views to the iOS11 application editing interface in iOS11 development". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report