Fall into the pit

Source: Internet
Author: User

1. Questions about custom Navigationcontroller settings

Such as: Secondviewcontroller inherits from a Fatherviewcontriller base class, Fatherviewcontriller it inherits from Uiviewcontroller, Some of the common parts of the control are set in Fatherviewcontroller, where Titlelabel is a property of its set caption, and if you want to modify the title in Secondviewcontroller, use the property modification directly, Navigation items cannot be modified using navigation items and can only be used on view controllers that inherit directly from Uiviewcontroller and are not used on a view controller that indirectly inherits from Uiviewcontroller.

[Email protected] "2134;

Workaround:?? Create a UIView control directly and add it to the Self.view

For example, a view controller that inherits directly from Uiviewcontroller can use navigation items: Navigationitem has a Titleview property and can set the caption.

? 2. About the use of Xib

When we drag a local small range of controls, it is convenient to use xib, but there is an easy place to ignore: when we want to encapsulate a control, the encapsulated control cannot be used on the parent class that has the subclass inheritance, because, when the subclass inherits, we have xib encapsulated controls that are not well inherited.

For example:

Create a control that inherits from UIView, named: CustomView, which has a button and a label on it and loads it onto Fatherviewcontroller, Fatherviewcontroller is a base class, There are many subclasses that inherit from Fatherviewcontroller, and these subclasses are not very good at inheriting the controls we have defined on the CustomView.

Workaround: Create a control on a custom-defined customview with pure handwritten code so that there is no problem that cannot be inherited.

?

? 3. Questions regarding the use of Uiscrollview

We use Uiscrollview primarily to display scrolling views, but often sometimes the view cannot be scrolled, summarizing several reasons:

(1) Frame not set

(2) No settings contentsize, or the display is smaller than the screen size

(3) IOS? There is a screen adaptive, to cancel

Fall into the pit

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.