`
jacky-zhang
  • 浏览: 315730 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

creating efficient layouts

阅读更多
The following points include some best practice guidelines for creating efficient layouts. Note that they
are not exhaustive.
➤ Avoid unnecessary nesting: Don’t put one layout within another unless it is necessary. A Linear
Layout within a Frame Layout, both of which are set to FILL_PARENT, does nothing but
add extra time to inflate. Look for redundant layouts, particularly if you’ve been making significant
changes to an existing layout.
➤ Avoid using too many Views: Each additional View in a layout takes time and resources to
inflate. A layout shouldn’t ever include more than 80 Views or the time taken to inflate it
becomes significant.
➤ Avoid deep nesting: As layouts can be arbitrarily nested, it’s easy to create complex, deeply
nested hierarchies. While there is no hard limit, it’s good practice to restrict nesting to fewer
than 10 levels.
It’s important that you optimize your layout hierarchies to reduce inefficiencies and eliminate unnecessary
nesting.
To assist you, the Android SDK includes the layoutopt command line tool. Call layoutopt, passing
in the name of the layout resource (or a resource folder) to have your layouts analyzed and to receive
recommendations for fixes and improvements.
分享到:
评论

相关推荐

    Expert Android Programming

    Then you will move onto creating app layouts, component and module building, creating smart and efficient UIs. The most important part of a modern day app is how real time they are. With this book, ...

    mcts70-515_microsoft_trainingkit.pdf

    - **Master Pages and Themes:** Design patterns for creating reusable layouts and styles, enhancing consistency and maintainability across web applications. - **Server Controls:** Built-in controls ...

    .Embedded.Linux.Development.with.Yocto.Project.1783282339

    Facilitates efficient system development by helping you avoid known pitfalls Demonstrates concepts in a practical and easy-to-understand way In Detail Starting with the very basics of the Yocto ...

    Introduction to Python Programming and Developing GUI Applications with PyQT

    ### Introduction to Python ... By mastering Python and PyQt, developers can create efficient, user-friendly, and scalable GUI applications that meet the needs of various industries and use cases.

    Collections

    They are used extensively in UITableView and UICollectionView to manage cell layouts and data. #### Customizing Memory and Storage Options: Pointer Collection Classes (OSX) Pointer collection ...

    R for beginner

    The `grid` package offers low-level functions for creating complex graphical layouts, while the `lattice` package provides high-level functions for creating trellis displays, which are particularly ...

    salesforce dev 501 Notes

    Constructing efficient SOQL queries is crucial for optimizing performance and ensuring accurate data retrieval. ### Triggers Triggers are Apex code blocks that execute automatically before or after ...

    python3.6.5参考手册 chm

    Python参考手册,官方正式版参考手册,chm版。以下摘取部分内容:Navigation index modules | next | Python » 3.6.5 Documentation » Python Documentation contents What’s New in Python ...

Global site tag (gtag.js) - Google Analytics