原文:http://www.cnblogs.com/kw-ios/p/3523525.html

有时,设计稿上的UI很漂亮,布局也整齐,但自己用代码写出来的就不行,不是这里高一点,就是那是低一点,使用DCIntrospect来查看元素信息调整布局,再也不用凭眼睛来估了。

使用方法:

Before you start make sure the DEBUG environment variable is set. DCIntrospect will not run without that set to prevent it being left in for production use.

Add the DCIntrospect class files to your project, add the QuartzCore framework if needed. To start:

[window makeKeyAndDisplay]

// always call after makeKeyAndDisplay.
#if TARGET_IPHONE_SIMULATOR
[[DCIntrospect sharedIntrospector] start];
#endif

The #if to target the simulator is not required but is a good idea to further prevent leaving it on in production code.

Once setup, simply push the space bar to invoke the introspect or then start clicking on views to get info. You can also tap and drag around the interface.

1、将DCIntrospect拖到工程中,添加QuartzCore framework;

2、在didFinishLaunchingWithOptions方法中,

//#if TARGET_IPHONE_SIMULATOR //可加可不加

[[DCIntrospect sharedIntrospector] start];

//#endif

OK,按下空格,点哪哪就有UI位置信息了(如果不好使,重启xcode试一试)

在真机上使用DCIntrospect,github上说的很清楚:

It can also be invoked via an app-wide `UIGestureRecognizer` if it is to be used on the device.

快捷键使用:http://blog.csdn.net/moniface/article/details/28860371

DCIntrospect -iOS界面调试的更多相关文章

  1. IOS界面调试神器DCIntrospect

    对于使用代码来写UI的同志,使用DCIntrospect来查看元素信息调整布局,再也不用凭眼睛来估了,先来看看截图 DCIntrospect是github上的开源项目:下载源码 大概介绍下用法: DC ...

  2. iOS 界面调试利器Reveal

    Reveal下载地址:http://revealapp.com/ ,目前要收费了,而且还不便宜,好东西都这样嘛~ 针对越狱设备和非越狱设备可以采取不同的方法,一种是在工程项目中加入Reveal.fra ...

  3. iOS高效调试

    写代码难免出现bug. 储备些调试技能绝对能够提高你的工作效率,让bug无所遁形.下面就和大家分享一些我在工作中常用的iOS调试小技能. 1. 打印 最简单,基础的调试方法就是打印日志了.贴出两段封装 ...

  4. iOS各种调试技巧豪华套餐

    转载自http://www.cnblogs.com/daiweilai/p/4421340.html 目录 前言 逼优鸡 知己知彼 百战不殆 抽刀断Bug 普通操作 全局断点(Global Break ...

  5. iOS界面开发

    [转载] iOS界面开发 发布于:2014-07-29 11:49阅读数:13399 iOS 8 和 OS X 10.10 中一个被强调了多次的主题就是大一统,Apple 希望通过 Hand-off ...

  6. iOS界面调试工具 Reveal-备用

    Reveal是一个iOS程序界面调试工具.使用Reveal,我们可以在iOS开发时动态地查看和修改应用程序的界面. 对于动态或复杂的交互界面,手写UI是不可避免的.通过Reveal,我们可以方便地调试 ...

  7. iOS 界面开发

    iOS 自动布局 iOS 界面 之 EALayout 无需反复编译,可视化实时界面,告别Storyboard AutoLayout Xib等等烦人的工具 iOS应用国际化教程(2014版) iOS开发 ...

  8. iOS 程序调试、测试方案

    1. iOS 之 界面调试 2. iOS 之 调试.解决BUG 3. iOS 程序测试.程序优化.提交前检测

  9. IOS各种调试

    IOS各种调试技巧豪华套餐   目录 前言逼优鸡知己知彼 百战不殆抽刀断Bug 普通操作 全局断点(Global BreakPoint) 条件断点(Condational Breakpoints)打印 ...

随机推荐

  1. C语言猜数字游戏

    猜数字游戏,各式各样的实现方式,我这边提供一个实现方式,希望可以帮到新手. 老程序猿就不要看了,黑呵呵 源代码1 include stdio.h include stdlib.h include ti ...

  2. 五.Jenkins安装plugin

    http://blog.csdn.net/jmyue/article/details/9376237

  3. 编译CM14.1(sudmod71.1)过程记录

    编译CM14.1内存要求很高,至少8G以上,我的6G也可以搞定,交换空间分配大一点. 1.安装平台 建议安装Deepin 15.3桌面版系统,系统UI好看. 2.配置环境 (1)安装编译依赖库 sud ...

  4. lightbox使用

    使用方法: 1.在页面头部包含 lightbox.js 文件并加载 lightbox.css 样式表文件 <script type="text/javascript" src ...

  5. UVA1368

    用一个二维数组装m个字符串,然后用一个数组装每个字符串的hamming距离.找到最小的hanming距离即可 #include<stdio.h> #include<string.h& ...

  6. shell脚本自动拉起启动程序

    一.我们先看看编写的shell脚本的内容,该shell的作用主要是实现监控某个程序崩溃之后就自动重启该进程. while true do procnum=` ps -ef|grep "tes ...

  7. nginx服务器http重定向到https的正确写法

    http重定向到https使用了nginx的重定向命令.那么应该如何写重定向?之前老版本的nginx可能使用了以下类似的格式. rewrite ^/(.*)$ http://domain.com/$1 ...

  8. CATransition的type属性类型

    用字符串表示 pageCurl            向上翻一页      pageUnCurl          向下翻一页      rippleEffect        滴水效果      s ...

  9. [转] mysql 存储引擎

    最常用的存储引擎 innodb MyISAM MyISAM,这种效率高,不支持事务,不支持外键,每个表有单独的存储文件(多个),方便管理. innodb,一般默认的都是innodb,效率也不低,支持事 ...

  10. C3P0连接池配置和实现详解

    一.配置 <c3p0-config> <default-config> <!--当连接池中的连接耗尽的时候c3p0一次同时获取的连接数.Default: 3 --> ...