2009年5月5日星期二

My bookmarks from Diigo 05/05/2009

  • tags: android, layout, view

    • android:id="@+id/my_button"
    • The at-symbol (@) at the beginning of the string indicates that the XML parser should parse and expand the rest
      of the ID string and identify it as an ID resource. The plus-symbol (+) means that this is a new resource name that must
      be created and added to our resources (in the R.java file). There are a number of other ID resources that
      are offered by the Android framework
    • When referencing an Android resource ID, you do not need the plus-symbol,
      but must add the android package namespace, like so:


      android:id="@android:id/empty"
  • tags: android, views, howto

    • Drawing the layout is a two pass process: a measure pass and a layout pass. The measuring
      pass is implemented in measure(int, int) and is a top-down traversal
      of the View tree. Each View pushes dimension specifications down the tree
      during the recursion. At the end of the measure pass, every View has stored
      its measurements. The second pass happens in
      layout(int, int, int, int) and is also top-down. During
      this pass each parent is responsible for positioning all of its children
      using the sizes computed in the measure pass.

Posted from Diigo. The rest of my favorite links are here.

没有评论: