Instructions for using XCode property panel

Source: Internet
Author: User

In Xcode, the Interface Builder tool is a powerful "WYSIWYG" development tool. This topic describes the property panel and object library panel.

 

Object Library panel:

Provides all the interface components defined by the Cocoa Touch library, including the View component and the Controller component (all components with the name xxxxController ).

Example:

Display the square in the default list

 

There are many components in the object library. For ease of search, the search bar is provided at the bottom, which is powerful. Generally, you only need to enter several key letters to quickly find the components you need.

 

 

 

Main Interface:

The main interface provides a design area that includes all the components we have designed. Generally, we need to put a container component first, such as the UIView view. Add other components to the view.

To quickly view related information on the main interface, you can view the information in the left-side Navigation Pane (Desk.

Tree Object List

 

Property panel:

Drag the UIImageView component found above to the main interface view.

This component provides an area for storing images. Open the right property Panel (the fourth one above)

It is divided into two areas: Image View and View, reflecting the inheritance relationship between the two classes.

UIImageView inherits from UIView. The properties in UIView can be directly used by UIImageView.

View attributes

(1) Mode: defines the internal alignment Mode and whether to scale to fit the view size;

(2) Tag: All sub-classes of UIView, including views and controls, can have a tag number. This number can be used in the program to find this component;

(3) Interaction;

(4) Alpha: the visibility of the background content. The value ranges from 0.0 to 1.0. The value ranges from 0.0 to 1.0. The value ranges from to. The value ranges from.

(5) Background: determines the Background color;

(6) Drawing: Opaque is not transparent. When Alpha is set to 1, it is not transparent. However, if a hole exists in the image, the image is still visible. If Opaque is selected, the entire layer is completely Opaque;

Hidden selected, the user cannot see this control;

When ClearsGraphics Context is selected, it will be overwritten by transparent black blocks, and the control is drawn on it, which is disabled by default;

ClipSubviews: if a child view is not completely included in the parent view, only the portion of the parent view is displayed after selection. This option is disabled by default;

AutoresizeSubviews: Allows iOS to adjust the size of the subview, which is selected by default;

(7) Stretching: (stretch) can be ignored. Stretch is required only when the rectangular view size is adjusted on the screen and needs to be re-drawn. Here, four floating point values (0.0-1.0) need to be set. If you want 10% of each side to be unable to be stretched, x y is set to 0.1 and widthheight is set to 0.8. The default values of x y are 0.0, and the width height is 1.0.


 

The View attribute above, usually keep the default, we select the picture displayed in the UIImageView area as the icon@2x.png, select this picture, you can modify its size in the fifth panel above


 

 

Text Box component UITextField

Select the text box component in the object library and drag it into the UIView.

 

The attributes of the text box are listed as follows:

(1) Text: Select Plain by default, and enter the prompt Text you want to display to the user at startup;

(2) Color: Set the text Color in the input box.

(3) Font: Font and size

(4) Alignment: Text Alignment

(5) Placeholder: used to specify the text that will be displayed in gray in the text field. If so, this field has no value. Placeholder character

(6) Background Disabled: Specifies the Background image and whether the Background image is applicable.

(7) Border Style: four buttons to change the Border Drawing Method of text fields. Generally, the default value is used.

(8) Clear Button:

(9) Clear When editing begins: Specifies the operation for the user to touch this field. If this option is selected, all values in this field will be deleted and the user can enter it again.

(10) Min Font Size: specify the minimum Size of the text to be smaller when the input text is more;

Adjustto Fit: Make sure the entire text is visible in the view;

 

The following attributes define the appearance and behavior of the keyboard when a text field is used.

(11) Capitalization: All Words in Words are automatically capitalized; Sentences control Sentences; All Characters All letters


(12) Corrention: Consistency


(13) Keyboard: Keyboard Arrangement


(14) Appearance: the Appearance of the <OK> button after input on the keyboard


(15) Auto-enable Return Key: selected. The return Key is disabled until at least one character is typed in the text field.

(16) Secure: Specifies whether the text box is used as the password box.

 


 

 

Close the keyboard:

After you press Done, a Did End On Exit event is generated.

-(IBAction) textFieldDoneEditing: (id) sender

{

[Sender resignFirstResponse]; // give up control of the first responder

}

 

User touch background close keyboard

Methods provided in the background controller class UIViewController

 

-(IBAction) backgroundTap: (id) sender

{

[XxxField resignFirstResponder];

}

 

Related Article

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.