Hierarchy Viewer工具使用
目前,在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工具使用的更多相关文章
- 看了一本书,说可以利用Hierarchy Viewer优化布局
看了一本书,说可以利用Hierarchy Viewer优化布局,今以志之. 参考:http://www.cnblogs.com/Rocky_/archive/2011/11/04/2236243.ht ...
- 利用Hierarchy Viewer优化布局
好久没更新博客了,趁着清明来写点什么. 今天来讲下如何使用android中提供的工具优化我们的布局.首先我们写一个最简单的框架布局. <?xml version="1.0" ...
- Android 实用工具Hierarchy Viewer实战
在Android的SDK工具包中,有很多十分有用的工具,可以帮助程序员开发和测试Android应用程序,大大提高其工作效率.其中的一款叫Hierachy Viewer的可视化调试工具,可以很方便地在开 ...
- 【转】【Android工具】被忽略的UI检视利器:Hierarchy Viewer
原文:http://blog.csdn.net/ddna/article/details/5527072 Hierarchy Viewer是随AndroidSDK发布的工具,位置在tools文件夹下, ...
- Android 卡顿优化 3 布局优化 工具 Hierarchy Viewer
欲善其事, 先利其器. 分析布局, 就不得不用到Hierarchy Viewer了. 本文工具使用皆以GithubApp的详情界面RepoDetailActivity为例说明. 为了不影响阅读体验, ...
- Android工具 Hierarchy Viewer 分析
Hierarchy Viewer是随AndroidSDK发布的工具,位置在tools文件夹下,名为hierarchyviewer.bat.它是Android自带的非常有用而且使用简单的工具,可以帮助我 ...
- Android 性能优化(22)*性能工具之「Hierarchy Viewer」 Hierarchy Viewer Walkthrough
Hierarchy Viewer Walkthrough 1.In this document Prerequisites Setting the ANDROID_HVPROTO variable W ...
- Android 性能优化(2)性能工具之「Hierarchy Viewer 」Optimizing Your UI:分析哪个view有性能问题,查看屏幕上某像素点的坐标,颜色等
Optimizing Your UI In this document Using Hierarchy Viewer Running Hierarchy Viewer and choosing a w ...
- Android工具:Hierarchy Viewer
Hierarchy Viewer 用途: 即可以用来优化自己的布局,也可以用来参考别人优秀的布局 打开方式: 运行工程,然后在\android-sdk-windows\tools目录下双击hierar ...
随机推荐
- input是否checked与使用jquery的attr或prop方法无关
最近在项目中有这样一个需求,用户在下单时可以选择优惠券,也可取消选择,并且可以多次选择,取消. 这是一个典型的input标签checked功能,博主使用radio元素实现此需求,但是优惠券只能选中,不 ...
- Linux常用命令List
参考<linux命令行大全> 一.文件命令 cd - 切换为之前目录 wc -l -w file cmd --help apropos keyword apropos cpu > t ...
- OpenDigg安卓开源项目月报201704
由OpenDigg 出品的安卓开源项目月报第一期来啦.我们的安卓开源月报集合了OpenDigg一个月来新收录的优质安卓开源项目,方便安卓开发人员便捷的找到自己需要的项目工具. DiscreteScro ...
- Robot framework的介绍
Robot framework是基于Python语言编写的功能自动化测试框架.使用简单,不懂编码的测试人员也能像编程一样写测试用例,支持关键字驱动测试并且可以开发系统关键字.还有丰富的第三方库,比如S ...
- [编织消息框架][网络IO模型]aio
asynchronous I/O (the POSIX aio_functions)—————异步IO模型最大的特点是 完成后发回通知. [编织消息框架][网络IO模型]NIO(select and ...
- oracle 归档日志满 报错ORA-00257: archiver error. Connect internal only, until freed
归档日志满导致无法用户无法登陆 具体处理办法 --用户登陆 Microsoft Windows [Version 6.1.7601] Copyright (c) Microsoft Corporati ...
- C#如何向word文档插入一个新段落及隐藏段落
编辑Word文档时,我们有时会突然想增加一段新内容:而将word文档给他人浏览时,有些信息我们是不想让他人看到的.那么如何运用C#编程的方式巧妙地插入或隐藏段落呢?本文将与大家分享一种向Word文档插 ...
- ob缓存
ob的基本原则:如果ob缓存打开,则echo的数据首先放在ob缓存.如果是header信息,直接放在程序缓存.当页面执行到最后,会把ob缓存的数据放到程序缓存,然后依次返回给浏览器.下面我说说ob的基 ...
- vim 字符串替换整理
公司项目测试,要在vi编辑其中进行多路径修改,这时候用到了字符串替换的知识,在这里我自己整理了一下. 一.基本内容替换,无特殊符号 :s/old/new/ 替换当前行第一个 old 为 new ...
- jdbc ,jdbcTemplate,MyBatis,Hibernate比较与分析
JDBC 1:jdbc(Java Data Base Connection 数据库连接)是一种用于执行sql语句的API,其中使用jdbc连接时需要的,Connection,Statement,Res ...