目前,在eclipse的ADT Android插件中,还不能启动Hierachy Viewer,但可以从Android SDK工具包中,通过命令行的方式可以启动,具体方法为,到Android SDK下的tools目录下,在命令行方式下运行hierachyviewer即可:

D:\android-sdk\tools>hierarchyviewer.bat

点上你要选择的应用。

看别人程序的布局:

抠图功能:

双击任何一个地方就可以保存成psd。

实例对比:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:background="@drawable/ccb_comm_bg0"
android:orientation="horizontal" >
<!-- android:background="@drawable/bg" -->
<com.example.health.util.CircleMenuLayout
android:id="@+id/id_menulayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="100dp"
android:background="@drawable/circle_bg3" > <RelativeLayout
android:id="@id/id_circle_menu_item_center"
android:layout_width="wrap_content"
android:layout_height="wrap_content" > <ImageView
android:layout_width="104.0dip"
android:layout_height="104.0dip"
android:layout_centerInParent="true"
android:background="@drawable/turnplate_center_unlogin" /> <ImageView
android:layout_width="116.0dip"
android:layout_height="116.0dip"
android:layout_centerInParent="true"
android:background="@drawable/turnplate_mask_unlogin_normal" />
</RelativeLayout>
</com.example.health.util.CircleMenuLayout> </LinearLayout>

要实现的效果:

TreeView:

点击某个视图,还可看见预览视图

抠图功能:

模仿版:

<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#fff2f0eb"
android:orientation="vertical" > <RelativeLayout
android:layout_width="fill_parent"
android:layout_height="@dimen/height_top_bar"
android:layout_weight="0"
android:background="@color/common_top_bar_blue" > <TextView
android:id="@+id/ivTitleName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="登陆"
android:textColor="#ffffffff"
android:textSize="20.0sp" />
<ImageButton
android:id="@+id/ivTitleBtnLeft"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:background="@drawable/top_icon_back" /> <TextView
android:id="@+id/ivTextViewRigh"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:textColor="#ffffffff"
android:textSize="16.0sp"
android:text="忘记密码"
android:clickable="true" /> </RelativeLayout> <ViewFlipper
android:id="@+id/mainFlipper"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
>
<LinearLayout
android:id="@+id/content1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:background="@color/login_background"
android:orientation="vertical" >
<LinearLayout
android:layout_margin="10dp"
android:padding="8dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:orientation="horizontal"
android:background="@drawable/inputbox_bg">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@drawable/input_phone"
/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="6"
android:background="@null"
android:textSize="15.0sp"
android:hint="填写您的手机号">
<requestFocus />
</EditText>
</LinearLayout> <LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:orientation="horizontal"
android:layout_marginTop="15dp"
android:background="@drawable/inputbox_bg">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@drawable/input_key"
/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="6"
android:background="@null"
android:textSize="15.0sp"
android:hint="输入您的登录密码"/>
</LinearLayout>
</LinearLayout>
<Button
android:id="@+id/sendBtn"
style="@style/style_common_btn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:background="@drawable/selector_common_btn"
android:text="登录" /> <TextView
android:id="@+id/regster_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:textColor="@color/common_top_bar_blue"
android:text="立即注册"
/>
</LinearLayout> <LinearLayout
android:id="@+id/content2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
</LinearLayout> </ViewFlipper> </LinearLayout>

效果:

ViewFlipper的使用:

 regster_text.setOnClickListener(new OnClickListener() {

        @Override
public void onClick(View v) {
ib_menu.setVisibility(View.VISIBLE);
ivTitleName.setText("注册新账号");
vf.showNext();
ib_back.setVisibility(View.GONE);
}
}); ib_menu.setOnClickListener(new OnClickListener() { @Override
public void onClick(View v) {
ib_back.setVisibility(View.VISIBLE);
ivTitleName.setText("登录");
vf.showPrevious();
ib_menu.setVisibility(View.GONE); }
});

Hierarchy Viewer工具使用的更多相关文章

  1. 看了一本书,说可以利用Hierarchy Viewer优化布局

    看了一本书,说可以利用Hierarchy Viewer优化布局,今以志之. 参考:http://www.cnblogs.com/Rocky_/archive/2011/11/04/2236243.ht ...

  2. 利用Hierarchy Viewer优化布局

    好久没更新博客了,趁着清明来写点什么. 今天来讲下如何使用android中提供的工具优化我们的布局.首先我们写一个最简单的框架布局. <?xml version="1.0" ...

  3. Android 实用工具Hierarchy Viewer实战

    在Android的SDK工具包中,有很多十分有用的工具,可以帮助程序员开发和测试Android应用程序,大大提高其工作效率.其中的一款叫Hierachy Viewer的可视化调试工具,可以很方便地在开 ...

  4. 【转】【Android工具】被忽略的UI检视利器:Hierarchy Viewer

    原文:http://blog.csdn.net/ddna/article/details/5527072 Hierarchy Viewer是随AndroidSDK发布的工具,位置在tools文件夹下, ...

  5. Android 卡顿优化 3 布局优化 工具 Hierarchy Viewer

    欲善其事, 先利其器. 分析布局, 就不得不用到Hierarchy Viewer了. 本文工具使用皆以GithubApp的详情界面RepoDetailActivity为例说明. 为了不影响阅读体验, ...

  6. Android工具 Hierarchy Viewer 分析

    Hierarchy Viewer是随AndroidSDK发布的工具,位置在tools文件夹下,名为hierarchyviewer.bat.它是Android自带的非常有用而且使用简单的工具,可以帮助我 ...

  7. Android 性能优化(22)*性能工具之「Hierarchy Viewer」 Hierarchy Viewer Walkthrough

    Hierarchy Viewer Walkthrough 1.In this document Prerequisites Setting the ANDROID_HVPROTO variable W ...

  8. Android 性能优化(2)性能工具之「Hierarchy Viewer 」Optimizing Your UI:分析哪个view有性能问题,查看屏幕上某像素点的坐标,颜色等

    Optimizing Your UI In this document Using Hierarchy Viewer Running Hierarchy Viewer and choosing a w ...

  9. Android工具:Hierarchy Viewer

    Hierarchy Viewer 用途: 即可以用来优化自己的布局,也可以用来参考别人优秀的布局 打开方式: 运行工程,然后在\android-sdk-windows\tools目录下双击hierar ...

随机推荐

  1. 老李分享:Robotium创建Note的实例

    老李分享:Robotium创建Note的实例   poptest是国内唯一一家培养测试开发工程师的培训机构,以学员能胜任自动化测试,性能测试,测试工具开发等工作为目标.如果对课程感兴趣,请大家咨询qq ...

  2. Selenium测试专项三班隆重开班

    Selenium测试专项三班隆重开班 应广大测试技术人员要求,以及企业技术需求.Selenium提前一周开课了,只针对合作的每家企业提供1-2个参训名额.预计培训60人次.但报名人数却远远超出我们预期 ...

  3. 老李分享:Web Services 组件 2

    WSDL 是一种基于 XML 的语言,它用来对 web service 及其如何访问进行描述. WSDL 表示 web service 描述语言(Web Services Description La ...

  4. 设置ARC有效或者无效

    在编译单位上,可以设置ARC有效或者无效.比如对每个文件可以选择使用或者不使用ARC,一个应用程序中可以混合ARC有效或者无效的二进制形式. 设置ARC有效的编译方法如下所示:(Xcode4.2开始默 ...

  5. [转]SecureCRT右键粘贴的设置

    1.习惯用putty的朋友,一般都习惯鼠标右键自动粘贴的功能,对于SecureCRT6.0.2 ,这个功能也已经是默认配置了. 老版本的SecureCRT其实也有这个功能,只是不是默认设置,很多人不知 ...

  6. 不可不知的 Android strings.xml 那些事

    相信 strings.xml 已经是大家在 Android 开发中最熟悉的文件之一了,但其实它也有很多需要注意的地方和一些小技巧,知道了这些可以让你的 Android 应用更加规范易用,大家来看看吧. ...

  7. 机器学习-scikit learn学习笔记

    scikit-learn官网:http://scikit-learn.org/stable/ 通常情况下,一个学习问题会包含一组学习样本数据,计算机通过对样本数据的学习,尝试对未知数据进行预测. 学习 ...

  8. Spring Ioc介绍和Bean的实例化

    一.IoC:Inverse of Control 控制反转   //  依赖注入  Dependency Injection 控制:某一接口具体实现类的选择权 反转:从调用者中移除控制权,转交第三方 ...

  9. OutOfMemoryError内存不足

    java.lang.OutOfMemoryError内存不足错误.当可用内存不足以让Java虚拟机分配给一个对象时抛出该错误. 造成此错误的原因有一下几个: 1.内存中加载的数据量过于庞大,如一次从数 ...

  10. python数据处理——numpy_2

    上一次的学习了numpy的一些基础操作,今天接着学习numpy的高级索引.轴对换数值转置以及作图. #花式索引 import numpy as np ''' t = np.empty((8,4)) # ...