OHOS-UIView-OnLongPressListener.md 3.8 KB
Newer Older
W
wenjun 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
# OHOS::UIView::OnLongPressListener<a name="ZH-CN_TOPIC_0000001055078167"></a>

## **Overview**<a name="section743482567093535"></a>

**Related Modules:**

[Graphic](Graphic.md)

**Description:**

Defines a long-press event listener. You need to register this listener with the view to listen to long-press events. 

**Since:**

1.0

**Version:**

1.0

## **Summary**<a name="section930024778093535"></a>

## Public Member Functions<a name="pub-methods"></a>

<a name="table1801485082093535"></a>
<table><thead align="left"><tr id="row2029407940093535"><th class="cellrowborder" valign="top" width="50%" id="mcps1.1.3.1.1"><p id="p1988889838093535"><a name="p1988889838093535"></a><a name="p1988889838093535"></a>Public Member Function Name</p>
</th>
<th class="cellrowborder" valign="top" width="50%" id="mcps1.1.3.1.2"><p id="p1079007439093535"><a name="p1079007439093535"></a><a name="p1079007439093535"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row1258752249093535"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.1 "><p id="p838618740093535"><a name="p838618740093535"></a><a name="p838618740093535"></a><a href="Graphic.md#gadd8ba1ff84abfc796ddeb9c6e5d46497">OnLongPress</a> (<a href="OHOS-UIView.md">UIView</a> &amp;view, const <a href="OHOS-LongPressEvent.md">LongPressEvent</a> &amp;event)</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.2 "><p id="p18387924093535"><a name="p18387924093535"></a><a name="p18387924093535"></a>virtual bool&nbsp;</p>
<p id="p111829855093535"><a name="p111829855093535"></a><a name="p111829855093535"></a>Called when a view is long pressed. </p>
</td>
</tr>
<tr id="row1233689617093535"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.1 "><p id="p541187875093535"><a name="p541187875093535"></a><a name="p541187875093535"></a><a href="Graphic.md#ga80d9a933818b4ae9c3f34fe78f65a8f6">~OnLongPressListener</a> ()</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.2 "><p id="p366654237093535"><a name="p366654237093535"></a><a name="p366654237093535"></a>virtual&nbsp;</p>
<p id="p1733408688093535"><a name="p1733408688093535"></a><a name="p1733408688093535"></a>A destructor used to delete the <strong id="b2143414095093535"><a name="b2143414095093535"></a><a name="b2143414095093535"></a><a href="OHOS-UIView-OnLongPressListener.md">OnLongPressListener</a></strong> instance. </p>
</td>
</tr>
<tr id="row171289226093535"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.1 "><p id="p1451435920093535"><a name="p1451435920093535"></a><a name="p1451435920093535"></a><a href="Graphic.md#ga4854963aa969ee20a6cd174a70f5cd23">operator new</a> (size_t size)</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.2 "><p id="p450165320093535"><a name="p450165320093535"></a><a name="p450165320093535"></a>void *&nbsp;</p>
<p id="p907231392093535"><a name="p907231392093535"></a><a name="p907231392093535"></a>Overrides the <strong id="b1757071992093535"><a name="b1757071992093535"></a><a name="b1757071992093535"></a>new</strong> function. </p>
</td>
</tr>
<tr id="row1294462979093535"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.1 "><p id="p1468544822093535"><a name="p1468544822093535"></a><a name="p1468544822093535"></a><a href="Graphic.md#gadf1997a0f56ac2b220e7f0f8e8e0a6ef">operator delete</a> (void *p)</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.2 "><p id="p1973766150093535"><a name="p1973766150093535"></a><a name="p1973766150093535"></a>void&nbsp;</p>
<p id="p787975215093535"><a name="p787975215093535"></a><a name="p787975215093535"></a>Overrides the <strong id="b912994109093535"><a name="b912994109093535"></a><a name="b912994109093535"></a>delete</strong> function. </p>
</td>
</tr>
</tbody>
</table>