mirror of
https://github.com/HackPlan/AsyncDisplayKit.git
synced 2026-04-23 03:20:39 +08:00
[AsyncDisplayKit.org] add Advanced Technologies, cleanup IHM, Layout Transition API
This commit is contained in:
@@ -2,11 +2,12 @@
|
||||
title: Hit Test Visualization
|
||||
layout: docs
|
||||
permalink: /docs/debug-tool-hit-test-visualization.html
|
||||
prevPage: synchronous-concurrency.html
|
||||
prevPage: corner-rounding.html
|
||||
nextPage: debug-tool-pixel-scaling.html
|
||||
---
|
||||
|
||||
##Visualize ASControlNode Tappable Areas##
|
||||
<br>
|
||||
This debug feature adds a semi-transparent highlight overlay on any ASControlNodes containing a `target:action:` pair or gesture recognizer. The tappable range is defined as the ASControlNode’s frame + its `.hitTestSlop` `UIEdgeInsets`. Hit test slop is a unique feature of `ASControlNode` that allows it to extend its tappable range.
|
||||
|
||||
In the screenshot below, you can quickly see that
|
||||
@@ -19,13 +20,14 @@ In the screenshot below, you can quickly see that
|
||||

|
||||
|
||||
##Restrictions##
|
||||
|
||||
<br>
|
||||
A _green_ border on the edge(s) of the highlight overlay indicates that that edge of the tapable area is restricted by one of it's superview's tapable areas. An _orange_ border on the edge(s) of the highlight overlay indicates that that edge of the tapable area is clipped by .clipsToBounds of a parent in its hierarchy.
|
||||
|
||||
##Usage##
|
||||
<br>
|
||||
In your `AppDelegate.m` file,
|
||||
<ul>
|
||||
<li>import `AsyncDisplayKit+Debug.h`</li>
|
||||
<li>add `[ASControlNode setEnableHitTestDebug:YES]` at the top of your `didFinishLaunchingWithOptions:` method</li>
|
||||
<li>add `[ASControlNode setEnableHitTestDebug:YES]` at the top of your AppDelegate's `didFinishLaunchingWithOptions:` method</li>
|
||||
</ul>
|
||||
Make sure to call this method before initializing any ASControlNodes - including ASButtonNodes, ASImageNodes, and ASTextNodes.
|
||||
|
||||
Reference in New Issue
Block a user