安卓的videoview 预览图怎么设置预览图

android VideoView播放视频-source
Android平台开发
开发语言:Java
实例大小:0.28M
下载次数:
浏览次数:
发布时间:
实例类别:Android平台开发
发 布 人:
所需积分:0
&相关标签:
同类人气实例源码
实例下载地址
android VideoView播放视频-source
不能下载?内容有错? 点击这里报错
好例子口号:伸出你的我的手 & 分享!
感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。
类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
Copyright &
好例子网(www.haolizi.net).All Rights Reserved备案编号:冀ICP备号 石公备号(10)根据 API 级别筛选:
&&&↳
&&&↳
&&&↳
android.widget.VideoView
Displays a video file.
The VideoView class
can load images from various sources (such as resources or content
providers), takes care of computing its measurement from the video so that
it can be used in any layout manager, and provides various display options
such as scaling and tinting.
继承的 XML 属性
来自 class
作为背景使用的可绘制对象.它可以是对完整得可绘制对象资源
(比如:PNG 图像、9片图、XML 状态列表描述等等)
或者是象“#ff000000”(黑色)这样得纯色.&
定义该视图是否响应点击事件.&
定义对视图内容的简短描述.&
定义半透明缓存的质量.&
当该属性设为真时,视图从它的容器视图取得可绘制状态(比如得焦点状态、
按下状态、等),而不是使用它自己的状态..&
定义滚动时淡出的边.&
定义淡出边的长度.&
指定当视图窗口被其他可视视图窗口遮挡时,是否过滤掉触控事件.&
布尔型内部属性,用于设置是否根据系统窗口(比如状态栏)来调整视图的布局.&
布尔值,用于控制视图是否可以获得焦点.&
布尔值,用于控制在触控模式下视图是否可以获得焦点.&
布尔值,控制发生诸如长按事件时,是否使用震动反馈.&
为当前视图设置一个标识名,以后可以通过调用
方法来取得视图.&
如果视图作为滚动容器使用,将该值设为真;
这意味它可以缩小占用的空间,以为输入法提供显示的空间.&
定义视图窗口可见时,是否保持屏幕始终处于开启状态.&
定义该视图是否响应长按事件.&
定义视图的最小高度.&
定义视图的最小宽度.&
定义焦点移动为
时,下一个获得焦点的视图.&
定义焦点移动为
时,下一个获得焦点的视图.&
定义焦点移动为
时,下一个获得焦点的视图.&
定义焦点移动为
时,下一个获得焦点的视图.&
单击视图时执行的视图上下文中的方法名.&
以像素为单位设置四条边的内边距.&
以像素为单位设置下边的内边距.&
以像素为单位设置左边的内边距.&
以像素为单位设置右边的内边距.&
以像素为单位设置上边的内边距.&
如果取消该设置,冻结视图时不保存视图的任何状态信息.&
以像数为单位的横向滚动条位置.&
以像数为单位的纵向滚动条位置
一定是尺寸值,由浮点数后跟长度单位组成。比如“14.5sp”。
可用单位有:px (像素)、dp (密度/设备无关像素)、sp (基于首选字体大小的缩放像素)、
in (英寸), mm (毫米).&
定义是否总是绘制横向滚动条滑道.&
定义是否总是绘制纵向滚动条滑道.&
以毫秒为单位定义淡出前等待时间.&
以毫秒为单位定义淡出所用时间.&
定义纵向滚动条的宽度和横向滚动条的高度.&
控制滚动条的位置和样式.&
定义用于横向滚动条把手的可绘制对象.&
定义用于纵向滚动条把手的可绘制对象.&
定义用于横向滚动条滑道的可绘制对象.&
定义用于纵向滚动条滑道的可绘制对象.&
定义显示那个方向的滚动条.&
布尔值,控制发生诸如点击、触控事件时是否使用声效.&
设置一个文本标签,以后可以通过调用
取得视图或者调用
来查找并取得视图.最好使用 ID(通过 android:id 属性定义)来代替
文本标签,因为它的速度更快,并且允许编译时类型检查.&
控制视图的初始可视性.&
继承的常量
来自 class
为绘图缓存启用自动质量控制模式.
为绘图缓存启用高质量控制模式.
为绘图缓存启用低质量控制模式.
指出视图没有设置状态.
指出视图可用、具有焦点并已选中.
指出视图可用、具有焦点、已选中并且其窗口具有焦点.
指出视图可用并具有焦点.
指出视图可用、具有焦点并且其窗口也具有焦点.
指出视图可用并已选中.
指出视图可用、已选中并且其窗口具有焦点.
指出视图时可用的.
根据不同的状态变更视图的外观.
指出视图可用并且其窗口具有焦点.
视图标志位,指出无论是否处于触控模式下,以及触控模式下是否可以获得焦点,
addFocusables(ArrayList, int, int)
函数都会添加该视图.
视图标志位,指出 addFocusables(ArrayList, int, int)
函数只添加在触控模式下可以获得焦点的视图.
指出视图具有焦点并且已选中.
指出视图具有焦点、已选中并且其窗口具有焦点.
指出视图得到焦点.
指出视图具有焦点并且其窗口也具有焦点.
用于 .移动焦点到前一个可选择条目.
用于 .向下移动焦点.
用于 .移动焦点到下一个可选择条目.
用于 .向左移动焦点.
用于 .向右移动焦点.
用于 .向上移动焦点.
视图不可见,并且不占用布局时的空间.用于 .
视图标志位,指示发生诸如长按事件时视图是否执行震动反馈.
视图不可见,但为其保留布局时所占用的空间.用于 .
视图标志位,用于指明当窗口包含对用户可见的该视图时,屏幕应该一直处于开启状态.
用于识别没有 ID 的视图.
总是允许用户过滚动该视图,用于可以滚动的视图.
允许用户对内容大于滚动区域的视图进行过滚动,用于可以滚动的视图.
不允许用户对该视图进行过滚动.
指出视图可按下、可用、具有焦点并与选中.
指出视图已按下、可用、具有焦点并且其窗口具有焦点.
指出视图已按下、可用并具有焦点.
指出视图已按下、可用、具有焦点并且其窗口具有焦点.
指出视图已按下、可用并且已选中.
指出视图已按下、可用、已选中并且其窗口具有焦点.
指出视图已按下并可用.
指出视图已按下、可用并且其窗口具有焦点.
质粗视图已按下、具有焦点并已选中.
指出视图已按下、具有焦点、已选中并且其窗口具有焦点.
指出视图已按下并具有焦点.
指出视图已按下、具有焦点并且其窗口具有焦点.
指出视图已按下并已选中.
指出视图已按下、已选中并且其窗口具有焦点.
指出视图已按下并且其窗口具有焦点.
用于在内边距内显示滚动条的滚动条风格,增加视图的内边距.
用于在内容区域显示滚动条的滚动条风格,不增加内边距.
用于在视图边上显示滚动条的滚动条风格,增加视图的内边距.
用于在视图边上显示滚动条的滚动条风格,不增加内边距.
指出视图已选中.
指出视图已选中并且其窗口具有焦点.
视图标志位,指示发生诸如单击、触控事件时视图是否播放声音效果.
在该类中使用 android.util.Log 输出日志时的标签.
视图可见.用于 .
指出视图的窗口具有焦点.
公有构造函数
( context)
( context,
( context,
attrs, int defStyle)
(int keyCode,
的默认实现.
实现该方法来处理触屏事件.
Implement this method to handle trackball motion events.
(int desiredSize, int measureSpec)
(int msec)
( controller)
Register a callback to be invoked when the end of a media file
has been reached during playback.
Register a callback to be invoked when an error occurs
during playback or setup.
Register a callback to be invoked when the media file
is loaded and ready to go.
(int widthMeasureSpec, int heightMeasureSpec)
评估视图及其内容,以决定其宽度和高度.此方法由
调用,子类可以重载以提供更精确、更有效率的衡量其内容尺寸的方法.
继承的方法
来自 class
调用此方法来绘出子视图.可被衍生类重写,以便在其子项被画出之前取得控制权.
在指定的画布上手动绘制视图(及其子视图).
This is used by the RootView to perform an optimization when
the view hierarchy contains one or several SurfaceView.
Return the SurfaceHolder providing access and control over this
SurfaceView's underlying surface.
当视图附加到窗体上时调用该方法.在这个时点,视图拥有了用于显示的表面,将开始绘制.
将视图从屏幕上分离的时候调用该方法.这个时点视图已经不具有可绘制部分.
(int widthMeasureSpec, int heightMeasureSpec)
评估视图及其内容,以决定其宽度和高度.此方法由
调用,子类可以重载以提供更精确、更有效率的衡量其内容尺寸的方法.
(int visibility)
当窗口中内容的可视性在
之间变更时调用.注意,该可视性代表你的窗口在窗口管理器中是否可见;并不
会告诉你属性为
的窗口在屏幕上是否可见.
(int visibility)
Set the enabled state of this view.
(boolean isMediaOverlay)
Control whether the surface view's surface is placed on top of another
regular surface view in the window (but still behind the window itself).
(boolean onTop)
Control whether the surface view's surface is placed on top of its
来自 class
addFocusables(&& views, int direction)
Add any focusable views that are descendants of this view (possibly
including this view if it is focusable itself) to views.
addFocusables(&& views, int direction, int focusableMode)
Adds any focusable views that are descendants of this view (possibly
including this view if it is focusable itself) to views.
addTouchables(&& views)
Add any touchable views that are descendants of this view (possibly
including this view if it is touchable itself) to views.
(int startDelay)
Trigger the scrollbars to draw.
(int startDelay, boolean invalidate)
Trigger the scrollbars to draw.
Trigger the scrollbars to draw.
Change the view's z order in the tree, so it's on top of other sibling
(boolean autoScale)
Forces the drawing cache to be built if the drawing cache is invalid.
Calling this method is equivalent to calling buildDrawingCache(false).
Cancels a pending long press.
Called by the
when a view who is not the current
input connection target is trying to make a call on the manager.
Cancels any animations for this view.
Called when this view wants to give up focus.
在水平范围内计算滚动条滑块的滚动范围.该值用来计算滚动条滑块的长度.
在水平范围内计算滚动条滑块的偏移量.该值用来计算水平滑块的位置.
计算滚动条水平方向上的滚动范围.
由父视图调用,用于通知子视图在必要时更新 mScrollX 和 mScrollY 的值。
该操作主要用于子视图使用
进行动画滚动时。
计算滚动条把手在纵向滚动范围内占用的幅度.该值用于计算滚动条把手在滚动条滑道中的长度.
计算滚动条把手在纵向滚动范围内的位置.该值用于计算滚动条把手在滚动条滑道中的位置.
计算滚动条代表的纵向范围.
Show the context menu for this view.
Frees the resources used by the drawing cache.
( newConfig)
Dispatch a notification about a resource configuration change down
the view hierarchy.
(int hint)
Dispatch a hint about whether this view is displayed.
调用此方法来绘出子视图.可被衍生类重写,以便在其子项被画出之前取得控制权.
按照焦点路径分发键盘事件到下一个视图.
Dispatch a key event before it is processed by any input method
associated with the view hierarchy.
Dispatches a key shortcut event.
的子视图中.
dispatchRestoreInstanceState(&& container)
Called by restoreHierarchyState(SparseArray) to retrieve the state for this view and its
dispatchSaveInstanceState(&& container)
Called by saveHierarchyState(SparseArray) to store the state for this view and its children.
(boolean pressed)
为视图的所有子视图调用 setPressed 方法.
(boolean selected)
为视图的所有子视图调用 setSelected 方法.
Pass the touch screen motion event down to the target view, or this
view if it is the target.
Pass a trackball motion event down to the focused view.
( focused, int direction)
对于具有焦点的视图及其祖先,该方法是处理箭头事件最后的机会.
( changedView, int visibility)
Dispatch a view visibility change down the view hierarchy.
(boolean hasFocus)
当包含的此视图的窗口获得或失去焦点时调用此方法.视图组应该重写此方法,
将消息传递到他的子视图.
(int visibility)
Dispatch a window visibility change down the view hierarchy.
在指定的画布上手动绘制视图(及其子视图).
在视图状态的变化影响到所显示可绘制对象的状态时调用该方法.
Find the view in the hierarchy rooted at this view that currently has
Look for a child view with the given id.
Look for a child view with the given tag.
Apply the insets for system windows to this view, if the FITS_SYSTEM_WINDOWS flag
(int direction)
Find the nearest view in the specified direction that can take focus.
Forces this view to be laid out during the next layout pass.
Get the animation currently associated with this view.
Retrieve a unique token identifying the top-level "real" window of
the window that this view is attached to.
Gets the background drawable
返回小部件顶端到文本基线的偏移量.如果小部件不支持基线对齐,该方法返回 -1.
Bottom position of this view relative to its parent.
返回底部渐变边缘的强度或密集度.强度的值介于0.0(无渐变)到1.0(全渐变)之间.
Amount by which to extend the bottom fading region.
description.
Returns the context the view is running in, through which it can
access the current theme, resources, etc.
如果视图要向上下文菜单加入额外信息,就应该实现该方法.返回的结果作为
回调函数的参数.
(int size, int measureSpec)
Utility to return a default size.
Return an array of resource IDs of the drawable states representing the
current state of the view.
(boolean autoScale)
Returns the bitmap in which this view drawing is cached.
Calling this method is equivalent to calling getDrawingCache(false).
Returns the quality of the drawing cache.
( outRect)
Return the visible drawing bounds of your view.
Return the time at which the drawing of the view hierarchy started.
Gets whether the framework should discard touches when the view's
window is obscured by another visible window.
(int direction)
Find and return all focusable views that are descendants of this view,
possibly including this view if it is focusable itself.
When a view has focus and the user navigates away from it, the next view is searched for
starting from the rectangle filled in by this method.
globalOffset)
If some part of this view is not clipped by any of its parents, then
return that area in r in global (root) coordinates.
Return the height of your view.
( outRect)
Hit rectangle in parent's coordinates
Returns the size of the horizontal faded edges used to indicate that more
content in this view is visible.
Returns the height of the horizontal scrollbar.
Returns this view's identifier.
Returns whether the screen should remain on, corresponding to the current
value of .
Return the global
for this view's window.
Get the LayoutParams associated with this view.
Left position of this view relative to its parent.
返回左渐变边缘的强度或密集度.强度的值介于0.0(无渐变)到1.0(全渐变)之间.
Amount by which to extend the left fading region.
(int[] location)
Computes the coordinates of this view in its window.
(int[] location)
Computes the coordinates of this view on the screen.
The height of this view as measured in the most recent call to measure().
The width of this view as measured in the most recent call to measure().
Returns the focus-change callback registered for this view.
Returns the over-scroll mode for this view.
Returns the bottom padding of this view.
Returns the left padding of this view.
Returns the right padding of this view.
Returns the top padding of this view.
Gets the parent of this view.
Returns the resources associated with this view.
Right position of this view relative to its parent.
返回右渐变边缘的强度或密集度.强度的值介于0.0(无渐变)到1.0(全渐变)之间.
Amount by which to extend the right fading region.
Finds the topmost view in the current view hierarchy.
Returns the current scrollbar style.
Return the scrolled left position of this view.
Return the scrolled top position of this view.
Override this if your view is known to always be drawn on top of a solid color background,
and needs to draw fading edges.
Returns the suggested minimum height that the view should use.
Returns the suggested minimum width that the view should use.
Returns the tag associated with this view and the specified key.
Returns this view's tag.
Top position of this view relative to its parent.
返回顶部渐变边缘的强度或密集度.强度的值介于0.0(无渐变)到1.0(全渐变)之间.
Amount by which to extend the top fading region.
Gets the TouchDelegate for this View.
Find and return all touchable views that are descendants of this view,
possibly including this view if it is touchable itself.
Returns the size of the vertical faded edges used to indicate that more
content in this view is visible.
Returns the width of the vertical scrollbar.
Returns the ViewTreeObserver for this view's hierarchy.
Returns the visibility status for this view.
Return the width of the your view.
Retrieve a unique token identifying the window this view is attached to.
Returns the current visibility of the window this view is attached to
(either , , or ).
( outRect)
Retrieve the overall visible display size in which the window this view is
attached to has been positioned in.
Returns true if this view has focus iteself, or is the ancestor of the
view that has focus.
Returns true if this view is focusable or if it contains a reachable View
returns true.
Returns true if this view is in a window that currently has window focus.
( context, int resource,
Inflate a view from an XML resource.
Initializes the fading edges from a given set of styled attributes.
Initializes the scrollbars from a given set of styled attributes.
Mark the the area defined by dirty as needing to be drawn.
(int l, int t, int r, int b)
Mark the the area defined by the rect (l,t,r,b) as needing to be drawn.
Invalidate the whole view.
( drawable)
Invalidates the specified Drawable.
Indicates whether this view reacts to click events or not.
Indicates whether the drawing cache is enabled for this view.
Indicates whether this duplicates its drawable state from its parent.
Returns the enabled status for this view.
Returns whether this View is able to take focus.
When a view is focusable, it may not want to take focus when in touch mode.
Returns true if this view has focus
Indicate whether the horizontal edges are faded when the view is
scrolled horizontally.
Indicate whether the horizontal scrollbar should be drawn or not.
Indicates whether this View is currently in edit mode.
Returns whether the device is currently in touch mode.
Indicates whether or not this view's layout will be requested during
the next hierarchy layout pass.
Indicates whether this view reacts to long click events or not.
Indicates whether this View is opaque.
If the View draws content inside its padding and enables fading edges,
it needs to support padding offsets.
Indicates whether the view is currently in pressed state.
Indicates whether this view will save its state (that is,
whether its
method will be called).
Returns true if scrollbars will fade when this view is not scrolling
Indicates the selection state of this view.
Returns the visibility of this view and all of its ancestors
Indicate whether the vertical edges are faded when the view is
scrolled horizontally.
Indicate whether the vertical scrollbar should be drawn or not.
(int l, int t, int r, int b)
Assign a size and position to a view and all of its
descendants
This is the second phase of the layout mechanism.
(int widthMeasureSpec, int heightMeasureSpec)
This is called to find out how big a view should be.
(int[] baseState, int[] additionalState)
Merge your own state values in additionalState into the base
state values baseState that were returned by
(int offset)
Offset this view's horizontal location by the specified amount of pixels.
(int offset)
Offset this view's vertical location by the specified number of pixels.
Invoked by a parent ViewGroup to notify the end of the animation
currently associated with this view.
Invoked by a parent ViewGroup to notify the start of the animation
currently associated with this view.
当视图附加到窗体上时调用该方法.在这个时点,视图拥有了用于显示的表面,将开始绘制.
Check whether the called view is a text editor, in which case it
would make sense to automatically display a soft input window for
( newConfig)
Called when the current configuration of the resources being used
by the application have changed.
Views should implement this if the view itself is going to add items to
the context menu.
(int extraSpace)
为当前视图生成新的
状态时发生.
( outAttrs)
Create a new InputConnection for an InputMethod to interact
with the view.
将视图从屏幕上分离的时候调用该方法.这个时点视图已经不具有可绘制部分.
(int hint)
Gives this view a hint about whether is displayed or not.
实现该方法,用于自己绘制内容.
Request the drawing of the horizontal and the vertical scrollbar.
Filter the touch event to apply security policies.
根据 XML 生成视图工作完成.该函数在生成视图的最后调用,在所有子视图添加完之后.
Called after
when the container is done
changing the view.
(boolean gainFocus, int direction,
previouslyFocusedRect)
当视图的焦点改变时调用.由定向导航导致的焦点变更时, direction 和
previouslyFocusedRect 提供了焦点是从那里来的进一步信息.
(int keyCode,
的默认实现.
(int keyCode,
Default implementation of : always returns false (doesn't handle
the event).
(int keyCode, int repeatCount,
的默认实现.
(int keyCode,
Handle a key event before it is processed by any input method
associated with the view hierarchy.
(int keyCode,
Called when an unhandled key shortcut event occurs.
(int keyCode,
的默认实现.
(boolean changed, int left, int top, int right, int bottom)
该视图设置其子视图的大小及位置时调用.派生类可以重写此方法,并为其子类布局.
(int widthMeasureSpec, int heightMeasureSpec)
评估视图及其内容,以决定其宽度和高度.此方法由
调用,子类可以重载以提供更精确、更有效率的衡量其内容尺寸的方法.
(int scrollX, int scrollY, boolean clampedX, boolean clampedY)
调用,用于响应过滚动操作.
允许视图重新应用之前由
保存的内部状态的回调函数.
允许视图保存其内部状态的回调函数,以便于之后使用相同状态创建新实例.
(int l, int t, int oldl, int oldt)
This is called in response to an internal scroll in this view (i.e., the
view scrolled its own contents).
(int alpha)
执行阿尔法变换时执行.子类可以使用该方法指定阿尔法值,然后返回真;
在调用 onDraw() 时,使用该阿尔法值.如果返回假,则先在不可见的缓存中绘制视图,
完成该请求;看起来不错,但是可能相对于在子类中绘制要慢.默认实现返回假.
(int w, int h, int oldw, int oldh)
布局时该视图的大小发生改变时调用该方法.如果是刚加入的视图,变更前的值为 0.
This is called when a container is going to temporarily detach a child, with
实现该方法来处理触屏事件.
Implement this method to handle trackball motion events.
( changedView, int visibility)
Called when the visibility of the view or an ancestor of the view is changed.
(boolean hasWindowFocus)
Called when the window containing this view gains or loses focus.
(int visibility)
当窗口中内容的可视性在
之间变更时调用.注意,该可视性代表你的窗口在窗口管理器中是否可见;并不
会告诉你属性为
的窗口在屏幕上是否可见.
(int deltaX, int deltaY, int scrollX, int scrollY, int scrollRangeX, int scrollRangeY, int maxOverScrollX, int maxOverScrollY, boolean isTouchEvent)
Scroll the view with standard behavior for scrolling beyond the normal
content boundaries.
如果该视图定义了 OnClickListener,则调用它.
(int feedbackConstant, int flags)
BZZZTT!!1!
Like , with additional options.
(int feedbackConstant)
BZZZTT!!1!
Provide haptic feedback to the user for this view.
Call this view's OnLongClickListener, if it is defined.
(int soundConstant)
Play a sound effect for this view.
Causes the Runnable to be added to the message queue.
( action, long delayMillis)
Causes the Runnable to be added to the message queue, to be run
after the specified amount of time elapses.
(int left, int top, int right, int bottom)
Cause an invalidate of the specified area to happen on a subsequent cycle
through the event loop.
Cause an invalidate to happen on a subsequent cycle through the event loop.
(long delayMilliseconds, int left, int top, int right, int bottom)
Cause an invalidate of the specified area to happen on a subsequent cycle
through the event loop.
(long delayMilliseconds)
Cause an invalidate to happen on a subsequent cycle through the event
Call this to force a view to update its drawable state.
Removes the specified Runnable from the message queue.
(int direction,
previouslyFocusedRect)
Call this to try to give focus to a specific view or to one of its descendants
and give it hints about the direction and a specific rectangle that the focus
is coming from.
(int direction)
Call this to try to give focus to a specific view or to one of its
descendants and give it a hint about what direction focus is heading.
Call this to try to give focus to a specific view or to one of its
descendants.
Call this to try to give focus to a specific view or to one of its descendants.
当某些变更导致视图的布局失效时调用该方法.该方法按照视图树的顺序调用.
( rectangle)
Request that a rectangle of this view be visible on the screen,
scrolling if necessary just enough.
( rectangle, boolean immediate)
Request that a rectangle of this view be visible on the screen,
scrolling if necessary just enough.
(int size, int measureSpec)
Utility to reconcile a desired size with constraints imposed by a MeasureSpec.
restoreHierarchyState(&& container)
Restore this view hierarchy's frozen state from the given container.
saveHierarchyState(&& container)
Store this view hierarchy's frozen state into the given container.
what, long when)
Schedules an action on a drawable to occur at a specified time.
(int x, int y)
Move the scrolled position of your view.
(int x, int y)
设置视图的滚动位置。会触发
事件,并使视图失效重绘。
(int eventType)
Handles the request for sending an
the event type.
Handles the request for sending an .
( animation)
Sets the next animation to play for this view.
(int color)
Sets the background color for this view.
将指定的可绘制对象设为背景;或删除背景.如果指定的可绘制对象有内边距,
则这个视图的内边距就会设为可绘制对象的内边距.然而,当背景被移除时,视图的内边距不变.
(int resid)
Set the background to a given resource.
(boolean clickable)
Enables or disables click events for this view.
( contentDescription)
description.
(int color)
Setting a solid background color for the drawing cache's bitmaps will improve
perfromance and memory usage.
(boolean enabled)
Enables or disables the drawing cache.
(int quality)
Set the drawing cache quality of this view.
(boolean enabled)
Enables or disables the duplication of the parent's state into this view.
(boolean enabled)
设置视图的可用状态.由子类决定视图的各可用状态如何显示.
(int length)
Set the size of the faded edge used to indicate that more content in this
view is available.
(boolean enabled)
Sets whether the framework should discard touches when the view's
window is obscured by another visible window.
(boolean focusable)
设置该视图是否可以获取焦点.
(boolean focusableInTouchMode)
设置在触控模式下该视图是否可以获取焦点.
(boolean hapticFeedbackEnabled)
Set whether this view should have haptic feedback for events such as
long presses.
(boolean horizontalFadingEdgeEnabled)
Define whether the horizontal edges should be faded when this view
is scrolled horizontally.
(boolean horizontalScrollBarEnabled)
Define whether the horizontal scrollbar should be drawn or not.
Sets the identifier for this view.
(boolean keepScreenOn)
Controls whether the screen should remain on, modifying the
value of .
Set the layout parameters associated with this view.
(boolean longClickable)
Enables or disables long click events for this view.
(int measuredWidth, int measuredHeight)
This mehod must be called by
to store the
measured width and measured height.
(int minHeight)
Sets the minimum height of the view.
(int minWidth)
Sets the minimum width of the view.
(int nextFocusDownId)
Set the id of the view to use for the next focus
(int nextFocusLeftId)
Set the id of the view to use for the next focus
(int nextFocusRightId)
Set the id of the view to use for the next focus
(int nextFocusUpId)
Set the id of the view to use for the next focus
注册点击该视图时执行的回调函数.如果该视图不可点击,会将其改为可以点击的状态.
Register a callback to be invoked when the context menu for this view is
being built.
Register a callback to be invoked when focus of this view changed.
Register a callback to be invoked when a key is pressed in this view.
Register a callback to be invoked when this view is clicked and held.
Register a callback to be invoked when a touch event is sent to this view.
(int overScrollMode)
为视图设置过滚动模式。有效的过滚动模式有
(默认值)、
(视图内容大于容器时允许过滚动)、
(int left, int top, int right, int bottom)
设置内边距.视图可能会根据滚动条的样式和可视性,增加一些必要的用于显示滚动条的空间.
(boolean pressed)
Sets the pressed that for this view.
(boolean enabled)
Controls whether the saving of this view's state is
enabled (that is, whether its
will be called).
(int style)
Specify the style of the scrollbars.
(boolean isScrollContainer)
Change whether this view is one of the set of scrollable containers in
its window.
(boolean fadeScrollbars)
Define whether scrollbars will fade when the view is not scrolling.
(boolean selected)
Changes the selection state of this view.
(boolean soundEffectsEnabled)
Set whether this view should have sound effects enabled for events such as
clicking and touching.
Sets a tag associated with this view and a key.
Sets the tag associated with this view.
( delegate)
Sets the TouchDelegate for this View.
(boolean verticalFadingEdgeEnabled)
Define whether the vertical edges should be faded when this view
is scrolled vertically.
(boolean verticalScrollBarEnabled)
Define whether the vertical scrollbar should be drawn or not.
(int visibility)
Set the enabled state of this view.
(boolean willNotCacheDrawing)
When a View's drawing cache is enabled, drawing is redirected to an
offscreen bitmap.
(boolean willNotDraw)
If this view doesn't do any drawing on its own, set this flag to
allow further optimizations.
显示该视图上下文菜单.
( animation)
Start the specified animation now.
Unschedule any events associated with the given Drawable.
Cancels a scheduled action on a drawable.
如果你的视图子类显示自己的可绘制对象,他应该重写此方法并为自己的每个可绘制对象返回真.
Returns whether or not this View can cache its drawing or not.
Returns whether or not this View draws on its own.
来自 class
Creates and returns a copy of this Object.
Compares this instance with the specified object and indicates if they
are equal.
Called before the object's memory is reclaimed by the VM.
&?&extends&&
Returns the unique instance of
that represents this
object's class.
Returns an integer hash code for this object.
Causes a thread which is waiting on this object's monitor (by means of
calling one of the wait() methods) to be woken up.
Causes all threads which are waiting on this object's monitor (by means
of calling one of the wait() methods) to be woken up.
Returns a string containing a concise, human-readable description of this
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.
(long millis, int nanos)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
(long millis)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
来自 interface
Called when the drawable needs to be redrawn.
what, long when)
A Drawable can call this to schedule the next frame of its
animation.
A Drawable can call this to unschedule an action previously
scheduled with .
来自 interface
(int keyCode,
Called when a key down event has occurred.
(int keyCode,
Called when a long press has occurred.
(int keyCode, int count,
Called when multiple down/up pairs of the same key have occurred
(int keyCode,
Called when a key up event has occurred.
来自 interface
(int eventType)
Handles the request for sending an
the event type.
Handles the request for sending an .
来自 interface
公有构造函数
( context)
( context,
( context,
attrs, int defStyle)
canSeekBackward
canSeekForward
getBufferPercentage
getCurrentPosition
getDuration
(int keyCode,
onTouchEvent
onTrackballEvent
resolveAdjustedSize
(int desiredSize, int measureSpec)
(int msec)
setMediaController
( controller)
setOnCompletionListener
setOnErrorListener
setOnPreparedListener
setVideoPath
setVideoURI
stopPlayback
(int widthMeasureSpec, int heightMeasureSpec)

我要回帖

更多关于 安卓 videoview 黑屏 的文章

 

随机推荐