checkedtextview 多选是什么控件

根据 API 级别筛选:
&&&↳
&&&↳
&&&↳
android.widget.CheckedTextView
对 TextView 的扩展,支持
以外的值的
是非常有用的.
继承的 XML 属性
来自 class
控制是否自动查找并转换 URL、邮箱地址等链接为可点击链接.默认值为"none",禁止该属性.&
如果设置,这表示该 TextView 的文本输入法可以自动更正常见拼写错误.&
决定 getText() 方法返回值的种类.默认值为 "normal".注意,EditText
和 LogTextBox 总是返回 Editable,及时你指定更低的基本也无济于事.&
如果设置该属性,则指定该 TextView 的文本输入法可以自动改变用户输入的字母为大写.&
使光标可见(默认)或隐藏.&
如果设置,则指定该 TextView 使用数字输入法,只接受指定的字符.&
在文本下方显示可绘制对象.&
在文本左侧显示可绘制对象.&
文本和可绘制对象的间距.&
在文本右侧显示可绘制对象.&
在文本上方显示可绘制对象.&
如果设置,则指定该 TextView 有输入法,如果没有特殊指定,其为文本输入状态.&
XML 资源,为输入法的特殊实现提供附加数据.只是当输入法启动时将资源
该值为真时,如果文字长度超过视图宽度,文字不会在中途被截断,
而是省略其中一部分.为了将文本作为一个整体显示在一行中,
你可能经常使用横向滚动条或者 singleLine 属性,
现在你也可以使用本属性,它还允许多行.&
使 TextView 精确匹配指定个数的字符宽度.&
如果设置,则文本视图会保持完整的文本内容,以及象当前光标位置这样的附近信息.&
指定当显示的文本比视图小时,横向和纵向的对齐方式.&
精确的设置 TextView 的高度.使用布局参数也可以达到相同效果.&
当文本为空时显示的提示信息.&
当输入法连接到文本视图时,提供用于
当输入法连接到文本视图时,提供用于
附近特性,可用于启动输入法与编辑器的关联,以提高你应用程序的集成效果.&
为上标和下标留出足够的空间,以取代字体上下标.默认为真.&
如果设置,即指定 TextView 使用指定的输入法(使用完全修饰类名).&
文本域中可放置的数据类型,用于帮助输入法决定如何让用户输入文本.&
文本行间距.&
用倍数指定的行间距.&
使 TextView 精确匹配指定行数的高度.&
如果设为假,即使指定的 autoLink 属性正确识别出了链接,点击也不会发生任何动作.&
字幕动画的重复次数.仅应用于启动字母动画的 TextView.&
使 TextView 的最大宽度为指定个数的字符宽度.&
设置 TextView 的最大高度.&
设置输入过滤器,限制输入的文本最大长度为指定值.&
使 TextView 的最大高度为指定行数的高度.&
设置 TextView 的最大宽度.&
使 TextView 的最小宽度为指定个数的字符宽度.&
设置 TextView 的最小高度.&
使 TextView 的最小高度为指定行数的高度.&
设置 TextView 的最小宽度.&
如果设置,指定 TextView 使用数值输入法.默认值为假.&
是否将文本域中的字符显示为代表密码的圆点.&
如果设置,则指定 TextView 使用电话号码输入法.默认为假.&
附加的内容类型,用于描述文本视图支持的输入法的私有实现.&
是否允许文本比视图宽(允许横向滚动).&
如果文本可选,当该视图得到焦点时将文本全部选中,而不只将光标移动到开始或结尾处.&
在文本后面显示指定颜色的阴影.&
阴影横向偏移量.&
阴影纵向偏移量.&
设置阴影的范围.&
限制文本显示与一行中,用横向滚动来代替多行显示.&
用于显示的文本
一定是字符串值,使用‘\\;’来转义字符。比如‘\\n’或用‘\\uxxxx’代表 UNICODE 字符。
也可以是对包含该类型值的资源(形式为
“@[package:]type:name”)或
主题属性(形式为
“?[package:][type:]name”)
相当于全局属性
资源符号 .&
基本的文字颜色、字体、大小和风格.&
可能是对其它资源的参照,形式为“@[+][package:]type:name”
或“?[package:][type:]name”形式的主题属性。
可能是颜色值,形式为“#rgb”、“#argb”、
“#rrggbb”或“#aarrggbb”。
相当于全局属性
资源符号 .&
选中文本的高亮部分的颜色.&
提示信息的文字颜色.&
超链接的文字颜色.&
设置文本的横向缩放因子.&
文字的大小.推荐以“sp(可缩放像素)”为单位来设置该值(比如 15sp).&
文字风格(粗体、斜体、粗斜体等).&
字体名称(楷体、宋体、仿宋、黑体等).&
精确的设置 TextView 的宽度.使用布局参数也可以达到相同效果.&
来自 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 resid)
将指定的资源 ID 对应的可绘制对象设置为选中标记.
(boolean checked)
改变文本视图的选中状态.
(int left, int top, int right, int bottom)
设置内边距.视图可能会根据滚动条的样式和可视性,增加一些必要的用于显示滚动条的空间.
反转当前视图控件的选中状态.
在视图状态的变化影响到所显示可绘制对象的状态时调用该方法.
(int extraSpace)
为当前视图生成新的
状态时发生.
实现该方法,用于自己绘制内容.
继承的方法
来自 class
( watcher)
Adds a TextWatcher to the list of those whose methods are called
whenever this TextView's text changes.
( text, int start, int end)
Convenience method: Append the specified text slice to the TextView's
display buffer, upgrading it to BufferType.EDITABLE if it was
not already editable.
Convenience method: Append the specified text to the TextView's
display buffer, upgrading it to BufferType.EDITABLE if it was
not already editable.
(int offset)
Move the point, specified by the offset, into the view if it is needed.
Cancels a pending long press.
to remove any IME composing
state from this text view.
计算滚动条水平方向上的滚动范围.
由父视图调用,用于通知子视图在必要时更新 mScrollX 和 mScrollY 的值。
该操作主要用于子视图使用
进行动画滚动时。
计算滚动条把手在纵向滚动范围内占用的幅度.该值用于计算滚动条把手在滚动条滑道中的长度.
计算滚动条代表的纵向范围.
(int depth)
Prints information about this view in the log output, with the tag
Returns true, only while processing a touch gesture, if the initial
touch down event caused focus to move to the text view and as a result
its selection changed.
的子视图中.
在视图状态的变化影响到所显示可绘制对象的状态时调用该方法.
( request,
If this TextView contains editable content, extract a portion of it
based on the information in request in to outText.
Gets the autolink mask of the text.
返回小部件顶端到文本基线的偏移量.如果小部件不支持基线对齐,该方法返回 -1.
Amount by which to extend the bottom fading region.
Returns the padding between the compound drawables and the text.
Returns drawables for the left, top, right, and bottom borders.
Returns the bottom padding of the view, plus space for the bottom
Drawable if any.
Returns the left padding of the view, plus space for the left
Drawable if any.
Returns the right padding of the view, plus space for the right
Drawable if any.
Returns the top padding of the view, plus space for the top
Drawable if any.
Return the current color selected to paint the hint text.
Return the current color selected for normal text.
子类覆盖该方法,已使其可以在默认 XML 选项未指定可编辑时设置 KeyListener.
子类覆盖该方法,以指定默认动作方法.
Return the text the TextView is displaying as an Editable object.
Returns where, if anywhere, words that are longer than the view
is wide should be ellipsized.
Returns the error message that was set to be displayed with
, or null if no error was set
or if it the error was cleared by the widget after user input.
Returns the extended bottom padding of the view, including both the
bottom Drawable if any and any extra space to keep more than maxLines
of text from showing.
Returns the extended top padding of the view, including both the
top Drawable if any and any extra space to keep more than maxLines
of text from showing.
Returns the current list of input filters.
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.
Return whether this text view is including its entire text contents
in frozen icicles.
Returns the horizontal and vertical alignment of this TextView.
Returns the hint that is displayed when the text of the TextView
Return the color used to paint the hint text.
Get the IME action ID previous set with .
Get the IME action label previous set with .
Get the type of the IME editor.
(boolean create)
Retrieve the input extras currently associated with the text view, which
can be viewed as well as modified.
Get the type of the content.
返回左渐变边缘的强度或密集度.强度的值介于0.0(无渐变)到1.0(全渐变)之间.
Amount by which to extend the left fading region.
(int line,
Return the baseline for the specified line (0...getLineCount() - 1)
If bounds is not null, return the top, left, right, bottom extents
of the specified line in it.
Return the number of lines of text, or 0 if the internal Layout has not
been built.
Returns the color used to paint links in the text.
Returns whether the movement method will automatically be set to
set to nonzero and links are detected in .
Get the private type of the content.
返回右渐变边缘的强度或密集度.强度的值介于0.0(无渐变)到1.0(全渐变)之间.
Amount by which to extend the right fading region.
Convenience for .
Convenience for .
返回 TextView 显示的文本.如果使用 BufferType.SPANNABLE 或 BufferType.EDITABLE
参数调用 setText() 方法,你可以将本方法的返回值分别转换为 Spannable 或 Editable.
( context,
attrs, int def)
Returns the default color from the TextView_textColor attribute
from the AttributeSet, if set, or the default color from the
TextAppearance_textColor from the TextView_textAppearance attribute,
if TextView_textColor was not set directly.
Return the set of text colors.
( context,
Returns the TextView_textColor attribute from the
Resources.StyledAttributes, if set, or the TextAppearance_textColor
from the TextView_textAppearance attribute, if TextView_textColor
was not set directly.
Amount by which to extend the top fading region.
Returns the total bottom padding of the view, including the bottom
Drawable if any, the extra space to keep more than maxLines
from showing, and the vertical offset for gravity, if any.
Returns the total left padding of the view, including the left
Drawable if any.
Returns the total right padding of the view, including the right
Drawable if any.
Returns the total top padding of the view, including the top
Drawable if any, the extra space to keep more than maxLines
from showing, and the vertical offset for gravity, if any.
Returns the list of URLSpans attached to the text
or otherwise) if any.
Return true iff there is a selection inside this text view.
( drawable)
Invalidates the specified Drawable.
Returns whether this text view is a current input method target.
If the View draws content inside its padding and enables fading edges,
it needs to support padding offsets.
Returns the length, in characters, of the text managed by this TextView
Move the cursor, if needed, so that it is at an offset that is visible
to the user.
当视图附加到窗体上时调用该方法.在这个时点,视图拥有了用于显示的表面,将开始绘制.
Called by the framework in response to a request to begin a batch
of edit operations through a call to link .
Check whether the called view is a text editor, in which case it
would make sense to automatically display a soft input window for
Called by the framework in response to a text completion from
the current input method, provided by it calling
Views should implement this if the view itself is going to add items to
the context menu.
( outAttrs)
Create a new InputConnection for an InputMethod to interact
with the view.
将视图从屏幕上分离的时候调用该方法.这个时点视图已经不具有可绘制部分.
实现该方法,用于自己绘制内容.
(int actionCode)
Called when an attached input method calls
for this text view.
Called by the framework in response to a request to end a batch
of edit operations through a call to link .
Called after
when the container is done
changing the view.
(boolean focused, int direction,
previouslyFocusedRect)
当视图的焦点改变时调用.由定向导航导致的焦点变更时, direction 和
previouslyFocusedRect 提供了焦点是从那里来的进一步信息.
(int keyCode,
的默认实现.
(int keyCode, int repeatCount,
的默认实现.
(int keyCode,
Called when an unhandled key shortcut event occurs.
(int keyCode,
的默认实现.
(int widthMeasureSpec, int heightMeasureSpec)
评估视图及其内容,以决定其宽度和高度.此方法由
调用,子类可以重载以提供更精确、更有效率的衡量其内容尺寸的方法.
即将绘制视图树时执行的回调函数。这时所有的视图都测量完成并确定了框架。
客户端可以使用该方法来调整滚动边框,甚至可以在绘制之前请求新的布局。
Called by the framework in response to a private command from the
current method, provided by it calling
允许视图重新应用之前由
保存的内部状态的回调函数.
允许视图保存其内部状态的回调函数,以便于之后使用相同状态创建新实例.
(int selStart, int selEnd)
This method is called when the selection has changed, in case any
subclasses would like to know.
This is called when a container is going to temporarily detach a child, with
( text, int start, int before, int after)
This method is called when the text is changed, in case any
subclasses would like to know.
Called when a context menu option for the text view is selected.
实现该方法来处理触屏事件.
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.
Call this view's OnLongClickListener, if it is defined.
( watcher)
Removes the specified TextWatcher from the list of those whose
methods are called
whenever this TextView's text changes.
(int mask)
Sets the autolink mask of the text.
Sets the size of the padding between the compound drawables and
Sets the Drawables (if any) to appear to the left of, above,
to the right of, and below the text.
Sets the Drawables (if any) to appear to the left of, above,
to the right of, and below the text.
(int left, int top, int right, int bottom)
Sets the Drawables (if any) to appear to the left of, above,
to the right of, and below the text.
(boolean visible)
Set whether the cursor is visible.
( factory)
Sets the Factory used to create new Editables.
指定当文字的长度超过视图宽度时用何种方式来取代简单的中途截断文本.
Makes the TextView exactly this many ems wide
Sets the right-hand compound drawable of the TextView to the "error"
icon and sets an error message that will be displayed in a popup when
the TextView has focus.
Sets the right-hand compound drawable of the TextView to the specified
icon and sets an error message that will be displayed in a popup when
the TextView has focus.
Apply to this text view the given extracted text, as previously
returned by .
( filters)
Sets the list of input filters that will be used if the buffer is
(int l, int t, int r, int b)
Assign a size and position to this view.
(boolean freezesText)
Control whether this text view saves its entire text contents when
freezing to an icicle, in addition to dynamic state such as cursor
(int gravity)
Sets the horizontal alignment of the text and the
vertical gravity that will be used when there is extra space
in the TextView beyond what is required for the text itself.
(int pixels)
Makes the TextView exactly this many pixels tall.
(int color)
Sets the color used to display the selection highlight.
Sets the text to be displayed when the text of the TextView is empty.
(int resid)
Sets the text to be displayed when the text of the TextView is empty,
from a resource.
(int color)
Sets the color of the hint text.
Sets the color of the hint text.
(boolean whether)
Sets whether the text should be allowed to be wider than the
( label, int actionId)
Change the custom IME action associated with the text view, which
will be reported to an IME with
when it has focus.
(int imeOptions)
Change the editor type integer associated with the text view, which
will be reported to an IME with
has focus.
(boolean includepad)
Set whether the TextView includes extra top and bottom padding to make
room for accents that go above the normal ascent and descent.
(int xmlResId)
Set the extra input data of the text, which is the
Bundle that will be filled in when creating an input connection.
(int type)
Set the type of the content with a constant as defined for
Sets the key listener to be used with this TextView.
(float add, float mult)
Sets line spacing for this TextView.
(int lines)
Makes the TextView exactly this many lines tall
Sets the color of links in the text.
(int color)
Sets the color of links in the text.
(boolean whether)
Sets whether the movement method will automatically be set to
set to nonzero and links are detected in .
(int marqueeLimit)
Sets how many times to repeat the marquee animation.
(int maxems)
Makes the TextView at most this many ems wide
(int maxHeight)
Makes the TextView at most this many pixels tall
(int maxlines)
Makes the TextView at most this many lines tall
(int maxpixels)
Makes the TextView at most this many pixels wide
(int minems)
Makes the TextView at least this many ems wide
(int minHeight)
Makes the TextView at least this many pixels tall
(int minlines)
Makes the TextView at least this many lines tall
(int minpixels)
Makes the TextView at least this many pixels wide
( movement)
Sets the movement method (arrow key handler) to be used for
this TextView.
Set a special listener to be called when an action is performed
on the text view.
(int left, int top, int right, int bottom)
设置内边距.视图可能会根据滚动条的样式和可视性,增加一些必要的用于显示滚动条的空间.
(int flags)
Sets flags on the Paint being used to display the text and
reflows the text if they are different from the old flags.
Set the private content type of the text, which is the
field that will be filled in when creating an input connection.
(int type)
Directly change the content type integer of the text view, without
modifying any other state.
(boolean selectAllOnFocus)
Set the TextView so that when it takes focus, all the text is
(boolean selected)
Changes the selection state of this view.
(float radius, float dx, float dy, int color)
Gives the text a shadow of the specified radius and color, the specified
distance from its normal position.
Sets the properties of this field (lines, horizontally scrolling,
transformation method) to be for a single-line input.
(boolean singleLine)
If true, sets the properties of this field (lines, horizontally
scrolling, transformation method) to be for a single-
if false, restores these to the default conditions.
( factory)
Sets the Factory used to create new Spannables.
(int resid,
(int resid)
Sets the string value of the TextView.
(char[] text, int start, int len)
Sets the TextView to display the specified slice of the specified
char array.
设置该 TextView 显示的文本(参见 )
以及是否可以保存在 styleable/spannable 缓存中,以及是否可以编辑.
( context, int resid)
Sets the text color, size, style, hint color, and highlight color
from the specified TextAppearance resource.
(int color)
Sets the text color for all the states (normal, selected,
focused) to be this color.
Sets the text color.
except that the cursor position (if any) is retained in the new text.
except that the cursor position (if any) is retained in the new text.
(float size)
Sets the extent by which text should be stretched horizontally.
(int unit, float size)
Set the default text size to a given unit and value.
(float size)
Set the default text size to the given value, interpreted as "scaled
pixel" units.
Sets the transformation that is applied to the text that this
TextView is displaying.
( tf, int style)
Sets the typeface and style in which the text should be displayed,
and turns on the fake bold and italic bits in the Paint if the
Typeface that you provided does not have all the bits in the
style that you specified.
Sets the typeface and style in which the text should be displayed.
(int pixels)
Makes the TextView exactly this many pixels wide.
如果你的视图子类显示自己的可绘制对象,他应该重写此方法并为自己的每个可绘制对象返回真.
来自 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
即将绘制视图树时执行的回调函数。这时所有的视图都测量完成并确定了框架。
客户端可以使用该方法来调整滚动边框,甚至可以在绘制之前请求新的布局。
来自 interface
(int eventType)
Handles the request for sending an
the event type.
Handles the request for sending an .
来自 interface
(boolean checked)
设置当前视图控件的选中状态.
反转当前视图控件的选中状态.
公有构造函数
CheckedTextView
( context)
CheckedTextView
( context,
CheckedTextView
( context,
attrs, int defStyle)
dispatchPopulateAccessibilityEvent
setCheckMarkDrawable
setCheckMarkDrawable
(int resid)
setChecked
(boolean checked)
setPadding
(int left, int top, int right, int bottom)
drawableStateChanged
onCreateDrawableState
(int extraSpace)}

我要回帖

更多关于 checkedtextview 样式 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信