win7下使用lldb调试_使用lldb和View调试器检查和更改视觉元素

本文介绍了如何在Windows 7环境下利用lldb调试器进行程序调试,特别是结合View Debugger来检查和修改视觉元素的技术。教程源于对原英文文章的翻译。
摘要由CSDN通过智能技术生成

win7下使用lldb调试

Have you ever added an element in an UIView and after checking in the simulator you realized that it was not what you were expecting?

您是否曾经在UIView中添加过元素,并且在签入模拟器后就意识到它不是您所期望的?

Well, our beloved Xcode has a very useful feature for inspecting visual elements, which is called View Debugger. This feature can be activated while your app is running by clicking in the button indicated in the image below, located in the debugger bar.

好吧,我们钟爱的Xcode具有检查视觉元素的非常有用的功能,称为View Debugger。 单击应用程序运行时,可通过单击调试器栏中下图所示的按钮来激活此功能。

了解View Debugger (Getting to know the View Debugger)

After clicking on the View Debugger button, Xcode will pause the execution of your application and capture the state of your current window.

单击“查看调试器”按钮后,Xcode将暂停应用程序的执行并捕获当前窗口的状态。

A screen similar to the one below will appear for you. Let’s try to understand what Xcode is showing us.

将会出现类似于以下屏幕的画面。 让我们尝试了解Xcode向我们展示了什么。

Image for post
Image from Apple developer portal
来自Apple开发人员门户的图片

Exploded 3D rendering of app views: The title describes the function itself. This area will show an exploded 3D view of your current UIWindow, showing all the elements.

应用程序视图的爆炸性3D渲染:标题描述了函数本身。 该区域将显示当前UIWindow的分解3D视图,并显示所有元素。

View hierarchy: Shows a list of all views and its constraints in the current UIWindow hierarchy. Views that are created by the system will also appear in this hierarchy.

视图层次结构:显示当前UIWindow层次结构中所有视图及其约束的列表。 系统创建的视图也将出现在此层次结构中。

View controls: These controls will change the visualization of the current exploded view, it is possible to inspect the views in 360 degrees and also zoom in/out, show/hide views and constraints.

视图控件:这些控件将更改当前爆炸视图的可视化,可以360度检查视图,还可以放大/缩小,显示/隐藏视图和约束。

Inspector area: In this area, you can see pieces of information about a selected object in the exploded view or the view hierarchy. The Object tab shows basic information about the selected view, the Size tab shows information about the size of the view and its constraints. It is also possible to select constraints in the view hierarchy and the exploded view and check its information details.

检查器区域:在该区域中,您可以在分解视图或视图层次结构中查看有关所选对象的信息。 “对象”选项卡显示有关所选视图的基本信息,“大小”选项卡显示有关视图的大小及其约束的信息。 也可以在视图层次结构和分解视图中选择约束并检查其信息详细信息。

You can also get information from a view by clicking the right button in the view hierarchy or the exploded view. You will be able to print information in the console, emphasize constraints, hide views that are in the front, or behind the view you selected.

您还可以通过在视图层次结构或分解视图中单击右键来从视图中获取信息。 您将能够在控制台中打印信息,强调约束条件,隐藏所选视图的前面或后面的视图。

Image for post

However, my favorite part of the view debugger is using it along with LLDB and the simulator. It is possible to inspect and change the properties of the elements in the current hierarchy without recompiling the project.

但是,我最喜欢的视图调试器部分是将它与LLDB和模拟器一起使用。 无需重新编译项目,就可以检查和更改当前层次结构中元素的属性。

更改UIView的属性 (<

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值