1、 When View Of measure After being confirmed , Would call ViewGroup Of layout Method , Then use onLayout Method ( It's also that the system doesn't automatically rewrite , We have to do it ourselves ) Ergodic View( root Measure In the same way ) And Measure At different times , Allow rewriting layout() Method .

analysis layout Source code :(P194 ①)

principle : adopt setFrame Method setting View The positions of the four vertices of , Then call onLayout Method to determine the position of the child element .

With LinearLayout Of onLayout Method (Vertial): Traversing the subelements of layout Method , increase childTop( Let the child View Position down ).

Because in general View No children View So there's no onLayout The necessary , Call directly View Provided layout The method is ok .

View How it works ( Two )——layout More articles about

  1. Android Art development and exploration chapter four ——View How it works ( On )

    This chapter is more interesting , Just to introduce View How it works , And customization View Implementation method , stay Android in ,View It's a very important role , Simply speaking ,View yes Android The presentation of vision in the world , On the interface Android carry ...

  2. Android Art development and exploration chapter four ——View How it works ( Next )

    Android Art development and exploration chapter four --View How it works ( Next ) Let's start with BB So much , This article is more or less about actual combat , The chairman asked me to understand more , Then I'll be more sincere , Less routine , old hand , Drive ! We are going to talk about ...

  3. Combing the source code View How it works

    welcome Follow my GitHub, Focus on my Nuggets . stay View In the course of our work , Perform three processes to complete the display , measurement (measure) technological process , Layout (layout) technological process , draw (draw) technological process . from perform ...

  4. 《Android Exploration of development Art 》 Reading notes (4) The first 4 Chapter View How it works

    This section and <Android From all over the world > No 3 Chapter Android Control architecture has something to do with custom control details , It is recommended to read the summary of this chapter first The first 4 Chapter View How it works 4.1 initial ViewRoot and DecorView ( ...

  5. Android Learning notes View How it works

    Customize View, Also called custom controls , By customizing View Can make the control to achieve a variety of customized effects . Implement customization View, Need to master View How it works at the bottom , such as View The measurement process of . Layout process and drawing process , besides , also ...

  6. View How it works ( One ) The overview View workflow

    View How it works ( One ) The overview View workflow Learn from <Android Exploration of development Art > Jane Book blogger - Blue sky and white cloud dream Overview Start with this chapter , Begin to learn View How it works , Include View Of ...

  7. View How it works ( One )——Measure

    One . know ViewRoot and DecorView When Activity When an object is created , Will DecorView Add to Window in , Create at the same time ViewRootImpl object (ViewRoot Corresponding to ViewRoo ...

  8. Android And view How it works 2

    Learning content View How it works at the bottom , such as View The measurement process of . Layout process and drawing process : And common View The callback method : Familiar with the knowledge in front of , Customize View I'll be more handy when I'm on the road . 4.1 First time to know ViewRoot ...

  9. Android in View How it works

    Android Medium View stay Android It plays an important role in our knowledge system . Simply speaking ,View Namely Android In the visual embodiment . The page we're showing is Android Provided GUI Combination of controls in Library . But when the requirements can't be met ...

  10. Four 、View How it works

    1.ViewRoot and DecorView ViewRoot Corresponding to ViewRootImpl class , It's a connection WindowManager and DecorView The link between ,View The three processes of are all through ViewRoot Come on ...

Random recommendation

  1. Coursera-Getting and Cleaning Data-Week2- Course notes

    Coursera-Getting and Cleaning Data-Week2 Saturday, January 17, 2015 Course overview week2 It mainly introduces how to read data from various sources . Include MySql ...

  2. ZOJ2332 Gems( Maximum flow )

    The title is about ,alsomagic There are gems , Gems have two properties: color and shape : He has a magic power that can transform a gem of some color and shape into a gem of another color and shape : His girlfriend has a certain amount of tolerance for all colors , And he himself has a certain understanding of every shape ...

  3. 【bzoj1053】 Anti prime number

    [bzoj1053] Anti prime number The question For any positive integer x, The number of its divisors is recorded as g(x). for example g(1)=1.g(6)=4. If a positive integer x Satisfy :g(x)>g(i) 0<i<x, said x Is an antiprime number . example ...

  4. C# Operation of the database on the point of code

    Operation of the database that bit of code , Don't bother to write every database SQLHelper,SQLiteHelper,OleDbHelper, 了 , It's all here . The interface doesn't work , Just extract the definition yourself . public abstract ...

  5. Yii install

    // install composer curl -s http://getcomposer.org/installer | php // hold composer Add to global command mv composer.phar ...

  6. java The reflex mechanism ( note )

    java The reflex mechanism is to take out class The corresponding method of for example Get constructor : Template : Class test = Class.forName("cn.test.Person");// Get the corresponding ...

  7. robot framework Customize python library

    Customize python Benefits of Library : robot framework Fill in the form , take python I lost my flexibility , But don't worry ,RF I've thought of a solution for a long time , It's about expanding your library . 1. stay python Create a new ...

  8. C++ Study ( 6、 ... and )(C The language part ) And Output

    Output learning notes ( It doesn't work , Keep it for yourself ) printf Used to output content Console black window printf(" What to output "); // Can be anything --> If you want to output variables 1. grid ...

  9. from Runoob Of Django What we learned in the tutorial

    Windows 10 Family Chinese ,Python 3.6.4,Django 2.0.3 Start learning this month Django, I found it on the Internet RUNOOB.COM The website found a Django course , stay “ Seriously ” After learning , preliminary ...

  10. Android Make it cool SVG Animation effect

    svg It's a very popular image file format right now ,svg Strictly speaking, it should be an open standard vector graphics language , Use svg Format we can directly use code to draw images , Can be opened with any word processing tool svg Images . Change part of the code to make the image have ...