跳转到相应内容

最常访问

最近访问

navigation

ZoomControls

public class ZoomControls
extends LinearLayout

java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.LinearLayout
         ↳ android.widget.ZoomControls


The ZoomControls class displays a simple set of controls used for zooming and provides callbacks to register for events.

Summary

Inherited XML attributes

Inherited constants

Inherited fields

Public constructors

ZoomControls(Context context)
ZoomControls(Context context, AttributeSet attrs)

Public methods

CharSequence getAccessibilityClassName()

Return the class name of this object to be used for accessibility purposes.

boolean hasFocus()

Returns true if this view has or contains focus

void hide()
boolean onTouchEvent(MotionEvent event)

Implement this method to handle touch screen motion events.

void setIsZoomInEnabled(boolean isEnabled)
void setIsZoomOutEnabled(boolean isEnabled)
void setOnZoomInClickListener(View.OnClickListener listener)
void setOnZoomOutClickListener(View.OnClickListener listener)
void setZoomSpeed(long speed)
void show()

Inherited methods

Public constructors

ZoomControls

added in API level 1
ZoomControls (Context context)

Parameters
context Context

ZoomControls

added in API level 1
ZoomControls (Context context, 
                AttributeSet attrs)

Parameters
context Context

attrs AttributeSet

Public methods

getAccessibilityClassName

added in API level 23
CharSequence getAccessibilityClassName ()

Return the class name of this object to be used for accessibility purposes. Subclasses should only override this if they are implementing something that should be seen as a completely new class of view when used by accessibility, unrelated to the class it is deriving from. This is used to fill in AccessibilityNodeInfo.setClassName.

Returns
CharSequence

hasFocus

added in API level 1
boolean hasFocus ()

Returns true if this view has or contains focus

Returns
boolean true if this view has or contains focus

hide

added in API level 1
void hide ()

onTouchEvent

added in API level 1
boolean onTouchEvent (MotionEvent event)

Implement this method to handle touch screen motion events.

If this method is used to detect click actions, it is recommended that the actions be performed by implementing and calling performClick(). This will ensure consistent system behavior, including:

  • obeying click sound preferences
  • dispatching OnClickListener calls
  • handling ACTION_CLICK when accessibility features are enabled

Parameters
event MotionEvent: The motion event.

Returns
boolean True if the event was handled, false otherwise.

setIsZoomInEnabled

added in API level 1
void setIsZoomInEnabled (boolean isEnabled)

Parameters
isEnabled boolean

setIsZoomOutEnabled

added in API level 1
void setIsZoomOutEnabled (boolean isEnabled)

Parameters
isEnabled boolean

setOnZoomInClickListener

added in API level 1
void setOnZoomInClickListener (View.OnClickListener listener)

Parameters
listener View.OnClickListener

setOnZoomOutClickListener

added in API level 1
void setOnZoomOutClickListener (View.OnClickListener listener)

Parameters
listener View.OnClickListener

setZoomSpeed

added in API level 1
void setZoomSpeed (long speed)

Parameters
speed long

show

added in API level 1
void show ()

此网站会使用 Cookie 来存储您在此网站上指定的语言和显示选项偏好设置。

获取最新的 Android Developers 资讯和提示,助您在 Google Play 上取得成功。

* 必填字段

成功!

在微信上关注 Google Developers

要以浏览此网站吗?

您请求访问的是网页,但是您为此网站设置的语言偏好为

要更改您的语言偏好设置并以浏览此网站吗?如果以后您想要更改语言偏好设置,请使用每个页面底部的语言菜单。

该类需要 或更高的 API 级别

此文档已被隐藏,因为您为该文档选择的 API 级别是 。您可以使用左侧导航栏上方的选择器来更改文档的 API 级别。

要详细了解如何根据您的应用需求指定 API 级别,请参阅支持不同平台版本

Take a short survey?
Help us improve the Android developer experience. (April 2018 — Developer Survey)