Use of hierarchyviewer under Android Studio

Source: Internet
Author: User

What is Hierarchyviewer

The Hierarchy Viewer is a tool released with ANDROIDSDK, located under the Tools folder, named Hierarchyviewer.bat. It's a very useful and easy-to-use tool for Android, which helps us to better view and design the user interface (UI), which is definitely a great tool for UI viewing, and details how to use the hierarchy Viewer in the Android Studio development environment.

How to use HierarchyViewer1 in the Android Studio development environment. Launch the simulator and run your app through the simulator ※hierarchyviewer is unable to connect to the real machine for debugging The layout file is as follows:
<?XML version= "1.0" encoding= "Utf-8"?><LinearLayoutxmlns:android= "Http://schemas.android.com/apk/res/android"Xmlns:tools= "Http://schemas.android.com/tools"Android:id= "@+id/activity_main"Android:layout_width= "Match_parent"Android:layout_height= "Match_parent"Android:paddingbottom= "@dimen/activity_vertical_margin"Android:paddingleft= "@dimen/activity_horizontal_margin"Android:paddingright= "@dimen/activity_horizontal_margin"Android:paddingtop= "@dimen/activity_vertical_margin"android:orientation= "vertical"Tools:context= "Com.why.project.confirmcanceldialogdemo.MainActivity">    <ButtonAndroid:id= "@+id/btn_confirm"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:text= "OK dialog box"/>    <ButtonAndroid:id= "@+id/btn_confirmcancel"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:text= "OK Cancel dialog box"/>    <ButtonAndroid:id= "@+id/btn_confirmcancelbetween"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:text= "OK to cancel Save dialog box"/>    <ButtonAndroid:id= "@+id/btn_notitle"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:text= "dialog box without caption"/>    <ButtonAndroid:id= "@+id/btn_message"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:text= "dialog box with a lot of content"/>    <TextViewAndroid:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:text= "Confirmcanceldialog" /></LinearLayout>
2. Open Android Device Monitor

The app runs first and then uses Android Device Monitor.

Click the menu Tools>Android>Android Device Monitor , such as:

3. Enter the Android Device monitor interface to open the Hierarchyviewer

4. Load the node of the current activity, select the analysis

Appendix 1 Saving a tree view as an image Appendix 2 shows the performance metrics (color dots) for each view node and the time-consuming time-consuming of measure, Layout, Draw, select a view, and then click the Swatch icon

Resources:

Use of hierarchyviewer under Android Studio

Using the hierarchy Viewer under Android Studio

How to open Hierarchyviewer in Androidstudio

Use of hierarchyviewer under Android Studio

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.