Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Programming \ About Auto Layout and frame     - ARM constant expression (Programming)

- Introduction to Linux system process monitoring tools (Linux)

- Linux system security configuration (Linux)

- Grading defense against Linux server attacks (Linux)

- Install RAID 6 (Striping double distributed parity) (Linux)

- php for Linux the MySQL extension module installation and configuration (Database)

- MySQL group_con cat_max_Len (Database)

- Configuring the PXE server in Ubuntu 14.04 (Server)

- Oracle RMAN backups of the control file backup (Database)

- Ceph cluster disk is no workaround for the remaining space (Server)

- JDK comes with tools JPS (Linux)

- Varnish configuration language VCL and its built-in variables (Server)

- Java exception handling mechanism (Programming)

- CentOS 6.4 compiler installed MySQL 5.6.14 (Database)

- Install Open vSwitch under CentOS 6.5 (Linux)

- Elaborate .NET Multithreading: Thread Pool (Programming)

- JavaScript original values and complex values (Programming)

- Virt Related Command Summary (Linux)

- Modify grub solve computer startup error: ERROR 17 (Linux)

- RabbitMQ tutorial examples: the Hello RabbitMQ World Java realization (Linux)

  About Auto Layout and frame
  Add Date : 2018-11-21      
  Used Auto Layout will certainly have encountered the situation obtaining less than the true frame, and most people can get through a simple search for a satisfactory solution: Before you want to get real about the call frame self.view.layoutIfNeeded () this is not a good method, but can be: carried out without additional frame computing needs.

We View Controller life cycle to analyze the problem:

Auto Layout layout is from outside to inside, from the beginning of the layout of the screen size, the layout has been to the innermost details of the elements, our eyes naturally fall on the viewDidLayoutSubviews and viewDidAppear:

viewDidLayoutSubviews the current view of the handle element has layout is completed, frame has been formed
viewDidAppear, the rendering system added to the current view of the parent view, displayed on the screen
Therefore, the solution is already get to the bottom:

Avoid calling layoutSubviews, conducted in frame acquisition and viewDidAppear in viewDidLayoutSubviews
If you need to do some big action as soon as possible, it is recommended viewDidLayoutSubviews, then the user has not seen the UI, more flexible usage
Note viewDidLayoutSubviews may be called multiple times, so the added element of the class action to avoid doing here
viewDidAppear can dry everything you wanted to do things, but some require the user to see things like animation can do here
Recommended more needs to be done to try to put all the viewDidAppear do, allowing users to see the screen as soon as possible, which is the basic principle of human-computer interaction
Back to the question in the title: when to get in the right frame viewDidLayoutSubviews and viewDidAppear in?.
- ogg start being given libnnz11.so: can not open shared object file (Database)
- Linux + Apache + PHP + Oracle based environment to build (Server)
- Swift defined type conversion and type aliases (typealias) (Programming)
- Eclipse-ee Tomcat browser can not start Tomcat, and Web project service deployment (Server)
- Safe learning through self-extracting package to achieve invasion (Linux)
- Advanced Linux security settings (Linux)
- Sort sql MySQL 5.6 upgrade slow Cause Analysis (Database)
- Error code: 2013 Lost connection to MySQL server during query (Database)
- Initialization and starting process of Linux (Linux)
- KVM QEMU virtual machine installation configuration under CentOS (Linux)
- Ubuntu font settings: Using Windows Font (Linux)
- Seven kinds of DDoS attack methods and techniques Defensive (Linux)
- Java uses JDBC connect database (Programming)
- Linux find command to find files (Linux)
- Apache Spark1.1.0 deployment and development environment to build (Server)
- Ubuntu Apache virtual host configuration (Server)
- Java memory area (Programming)
- State and Linux nf_conntrack TCP disconnect time (Programming)
- Change all child files and subdirectories in the owner permissions Ubuntu (Linux)
- To install Python-Pip and Fabric under CentOS / Ubuntu (Linux)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.