Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Programming \ About Auto Layout and frame     - Zabbix monitoring different versions of RAID installation and monitoring and MySQL master-slave monitor (Server)

- To achieve a two-way static NAT stateless available modules on Linux (Linux)

- Fedora 21 setting boot script (Linux)

- Linux --- file descriptors and redirection (Linux)

- Ubuntu 12.04 installation instructions under GAMIT10.40 (Linux)

- Zookeeper cluster deployment (Server)

- Ubuntu achieve initialization iptables (Linux)

- fcntl file locking function add (Programming)

- Configuring DNS process under CentOS 6.5 (Server)

- Bash mathematical extension (Programming)

- Node.js form --formidable (Programming)

- Ora-00600 [fast hot Atkins soft _ that _ Oh, of course not _less_ profile] (Database)

- To install MySQL 5.6 binary packages under CentOS 6.4 64bit (Database)

- Linux network monitoring strategy (Linux)

- Android use canvas board painting (Programming)

- Repair fatal error in Linux: lame / lame.h: No such file or dir Error (Linux)

- To set up the printer use Nagios Monitoring Server (Server)

- Openfire Hazelcast cluster Detailed (Server)

- Oracle set and remove columns unavailable (Database)

- Repair Chrome for Linux is (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:

viewDidLoad
viewWillAppear
viewWillLayoutSubviews
viewDidLayoutSubviews
viewDidAppear
viewWillDisappear
viewDidDisappear
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?.
     
         
       
         
  More:      
 
- AngularJS asynchronous service testing and Mocking (Programming)
- Teach you how to choose to install CentOS 6.5 installation package (Linux)
- Linux disk partition batch format mount script (Linux)
- Linux install Eclipse for C / C ++ Development (Linux)
- RedHat6.4 installation tutorial --- Minimal Edition (Linux)
- MySQL Slave synchronization problem solving (Database)
- CentOS7 install and configure Nagios (Server)
- Summarize small problems encountered in the use Lua (Programming)
- Linux host dual LAN transceiver package ARP problem (Linux)
- LVM Disk Manager Application (Linux)
- Linux variable learning experience (Linux)
- How to query the role of Linux services (Linux)
- Ubuntu and Derivative Edition users install LMMS 0.4.15 (Linux)
- How Vim playing a mature IDE (Linux)
- Linux remote wake the computer original code [C] (Linux)
- VMware virtual machine operating system log Error in the RPC receive loop resolve (Linux)
- Linux firewall settings -DNS server articles (Server)
- Binary tree traversal recursive and non-recursive (cyclic) traversal achieve (Programming)
- JavaScript is implemented without new keywords constructor (Programming)
- How to configure chroot environment in Ubuntu 14.04 (Linux)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.