- 浏览: 684348 次
- 性别:
- 来自: 上海
文章分类
最新评论
-
Hippyqq:
谢谢很有用,
java中遍历MAP的几种方法 -
XSoftlab:
超详细。。。Java map 详解 - 用法、遍历、排序、常用 ...
java中遍历MAP的几种方法 -
bobo22:
importnet.sf.fmj.ui.application ...
java来调用电脑视频摄像头拍照进行截图 -
qq981378640:
#include <stdio.h>
int ...
c语言中unsigned类型和普通类型间的转换 -
qq981378640:
楼主你这样有点复杂了,直接这样写更好更方便
#include ...
c语言中unsigned类型和普通类型间的转换
包位置:android.widget.TextView
XML Attributes
Attribute Name Related Method Description
android:autoLink setAutoLinkMask(int) Controls whether links such as urls and email
addresses are automatically found and converted
to clickable links.
android:autoText setKeyListener(KeyListener) If set, specifies(说明) that this TextView has
a textual( 原文的、原版的) input method
and automatically corrects some common
spelling errors. (PS:如果设置的话,会有一个默认的输入法,
帮助修改拼写错误)
android:bufferType setText(CharSequence,TextView.BufferType) Determines the minimum type that
getText() will return.
android:capitalize
setKeyListener(KeyListener)
If set, specifies that this TextView has a textual input method and should automatically capitalize what the user types. (PS:吧用户输入的东西自动的转化成大写字母)
android:cursorVisible
setCursorVisible(boolean)
Makes the cursor visible (the default) or invisible
Must be a boolean value, either "true" or "false".
android:digits(数字)
setKeyListener(KeyListener)
If set, specifies that this TextView has a numeric input method and that these specific characters are the ones that it will accept. (如果设置只可以输入数字)
android:drawableBottom
setCompoundDrawablesWithIntrinsicBounds(Drawable,Drawable,Drawable,Drawable)
The drawable to be drawn below the text.
android:drawableLeft
setCompoundDrawablesWithIntrinsicBounds(Drawable,Drawable,Drawable,Drawable)
The drawable to be drawn to the left of the text.
android:drawablePadding
setCompoundDrawablePadding(int)
The padding between the drawables and the text.
android:drawableRight
setCompoundDrawablesWithIntrinsicBounds(Drawable,Drawable,Drawable,Drawable)
The drawable to be drawn to the right of the text.
android:drawableTop
setCompoundDrawablesWithIntrinsicBounds(Drawable,Drawable,Drawable,Drawable)
The drawable to be drawn above the text.
android:editable
If set, specifies that this TextView has an input method.
android:editorExtras
setInputExtras(int)
Reference to an <input-extras> XML resource containing additional data to supply to an input method, which is private to the implementation of the input method.
android:ellipsize
setEllipsize(TextUtils.TruncateAt)
If set, causes words that are longer than the view is wide to be ellipsized instead of broken in the middle. (如果字数较多变形,而不是不居中)
android:ems
setEms(int)
Makes the TextView be exactly this many ems wide
Must be an integer value, such as "100".
android:freezesText
setFreezesText(boolean)
If set, the text view will include its current complete text inside of its frozen icicle in addition to meta-data such as the current cursor position. (不仅保持文字而且保持元数据,比如光标的位置)
android:gravity
setGravity(int)
Specifies how to align the text by the view's x and/or y axis when the text is smaller than the view.(当文本比组件小的时候, 如何和组件的X/Y轴 对齐)
android:height
setHeight(int)
Makes the TextView be exactly this many pixels tall.
android:hint
setHint(int)
Hint text to display when the text is empty. (当标签是空的时候,在标签中显示什么数据)
android:imeActionId
setImeActionLabel(CharSequence,int)
Supply a value for EditorInfo.actionId used when an input method is connected to the text view.
android:imeActionLabel
setImeActionLabel(CharSequence,int)
Supply a value for EditorInfo.actionLabel used when an input method is connected to the text view.
android:imeOptions
setImeOptions(int)
Additional features you can enable in an IME associated with an editor, to improve the integration with your application.
android:includeFontPadding
setIncludeFontPadding(boolean)
Leave enough room for ascenders and descenders instead of using the font ascent and descent strictly.
android:inputMethod
setKeyListener(KeyListener)
If set, specifies that this TextView should use the specified input method (specified by fully-qualified class name).
android:inputType
setRawInputType(int)
The type of data being placed in a text field, used to help an input method decide how to let the user enter text.
android:lineSpacingExtra
setLineSpacing(float,float)
Extra spacing between lines of text. (行间距)
android:lineSpacingMultiplier
setLineSpacing(float,float)
Extra spacing between lines of text, as a multiplier. (行间距)倍数
android:lines
setLines(int)
Makes the TextView be exactly this many lines tall
Must be an integer value, such as "100".
android:linksClickable
setLinksClickable(boolean)
If set to false, keeps the movement method from being set to the link movement method even if autoLink causes links to be found. (设置连接是否可用)
android:marqueeRepeatLimit
setMarqueeRepeatLimit(int)
The number of times to repeat the marquee animation. (来回滚动的次数)
android:maxEms
setMaxEms(int)
Makes the TextView be at most this many ems wide
Must be an integer value, such as "100".
android:maxHeight
setMaxHeight(int)
Makes the TextView be at most this many pixels tall
Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
android:maxLength
setFilters(InputFilter)
Set an input filter to constrain the text length to the specified number.
android:maxLines
setMaxLines(int)
Makes the TextView be at most this many lines tall
Must be an integer value, such as "100".
android:maxWidth
setMaxWidth(int)
Makes the TextView be at most this many pixels wide
Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
android:minEms
setMinEms(int)
Makes the TextView be at least this many ems wide
Must be an integer value, such as "100".
android:minHeight
setMinHeight(int)
Makes the TextView be at least this many pixels tall
Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
android:minLines
setMinLines(int)
Makes the TextView be at least this many lines tall
Must be an integer value, such as "100".
android:minWidth
setMinWidth(int)
Makes the TextView be at least this many pixels wide
Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
android:numeric
setKeyListener(KeyListener)
If set, specifies that this TextView has a numeric input method.
android:password
setTransformationMethod(TransformationMethod)
Whether the characters of the field are displayed as password dots instead of themselves. (是否是以密码的方式显示)
android:phoneNumber
setKeyListener(KeyListener)
If set, specifies that this TextView has a phone number input method.
android:privateImeOptions
setPrivateImeOptions(String)
An addition content type description to supply to the input method attached to the text view, which is private to the implementation of the input method.
android:scrollHorizontally
setHorizontallyScrolling(boolean)
Whether the text is allowed to be wider than the view (and therefore can be scrolled horizontally). (在文字较多的情况下是否允许滚动)
android:selectAllOnFocus
setSelectAllOnFocus(boolean)
If the text is selectable, select it all when the view takes focus instead of moving the cursor to the start or end. (如果选择是否选择所有)
android:shadowColor
setShadowLayer(float,float,float,int)
Place a shadow of the specified color behind the text. (如果有颜色是否显示影印)
android:shadowDx
setShadowLayer(float,float,float,int)
Horizontal offset of the shadow.
android:shadowDy
setShadowLayer(float,float,float,int)
Vertical offset of the shadow.
android:shadowRadius
setShadowLayer(float,float,float,int)
Radius of the shadow.
android:singleLine
setTransformationMethod(TransformationMethod)
Constrains the text to a single horizontally scrolling line instead of letting it wrap onto multiple lines, and advances focus instead of inserting a newline when you press the enter key.
android:text
setText(CharSequence)
Text to display.
android:textColor
setTextColor(ColorStateList)
Text color.
android:textColorHighlight
setHighlightColor(int)
Color of the text selection highlight.
android:textColorHint
setHintTextColor(int)
Color of the hint text. (提示文字)
android:textColorLink
setLinkTextColor(int)
Text color for links.
android:textScaleX
setTextScaleX(float)
Sets the horizontal scaling factor for the text
Must be a floating point value, such as "1.2".
android:textSize
setTextSize(float)
Size of the text.
android:textStyle
setTypeface(Typeface)
Style (bold, italic, bolditalic) for the text.
android:typeface
setTypeface(Typeface)
Typeface (normal, sans, serif, monospace) for the text.
android:width
setWidth(int)
Makes the TextView be exactly this many pixels wide.
4: 构造函数
Public Constructors
TextView(Context context)
TextView(Context context, AttributeSet attrs)
TextView(Context context, AttributeSet attrs, int defStyle)
来自http://blog.csdn.net/wbw1985/archive/2010/03/12/5372820.aspx
发表评论
-
android应用 获取本地指定类型文件 的两种最优方法
2013-04-07 16:29 14160刚因为项目有需求,需求移动应用获取本地文件有下面两个 第一个 ... -
android 滚动条
2011-01-17 14:05 2114在ListView中添加属性: android:scrollb ... -
LayoutInflater的使用 android
2010-10-28 15:54 1175在实际开发种LayoutInflater这个类还是非常有用的, ... -
Android虚拟机大屏幕设置(开发平板电脑程序)
2010-08-31 10:33 2979如果使用android进行大屏幕开发,比如开发基于androi ... -
adb shell下使用命令行删除android系统中指定文件和文件夹
2010-08-25 13:07 26330记录一下命令: tools>adb remount t ... -
Android permission 访问权限大全
2010-07-30 23:03 1160androidmanifest.xml中声明相关权限请求, 完 ... -
android实现底部菜单栏
2010-07-29 15:56 7169android程序,许多时候需要菜单栏显示在底部或顶部,但是没 ... -
Android ExpandableListActivity 学习笔记
2010-07-27 21:33 3401An activity that displays an ex ... -
[转]android animation的应用实例
2010-07-20 23:13 1852此文件名为myanimation.xml 位于 res/ani ... -
Android入门第八篇之GridView(九宫图)
2010-07-15 17:32 2544GridView更是实现九宫图的首选!本文就是介绍如何使用Gr ... -
Android入门第五篇之TableLayout (二)//生成10行,8列的表格
2010-07-15 14:02 4182TableLayout添加数据(9宫图也可以用TableLay ... -
Android工具之Hierarchy Viewer--分析应用程序UI布局
2010-07-14 23:37 3689Android SDK提供的Hierarchy Viewer工 ... -
apk打包
2010-07-14 23:27 10404什么是apk文件 APK是Android Package Ki ... -
Android Intent的几种用法全面总结
2010-07-14 18:05 1183Intent, 用法 Intent应该算是Android中特有 ... -
进度条(ProgressBar)拖动条(SeekBar)android
2010-07-12 17:28 16772本文源自http://www.cnblogs.com/Terr ... -
Activity的跳转与传值
2010-07-05 16:54 3212Activity跳转与传值,主要是通过Intent类来连接多个 ... -
android:属性 layout_alignParentRight android:paddingRight
2010-07-03 22:59 11539android:layout_alignParentRight ... -
android模拟器输入中文
2010-06-29 16:50 2813首先:在设置里,选区域和文本,里面把谷歌拼音输入法复选上,就o ... -
Android Map开发基础知识学习笔记
2010-06-29 11:14 3466注册 Android 地图 API 密钥 运行:keyto ... -
Android MapView 申请apiKey
2010-06-29 11:01 13041. 首先先要获取你的debug keystore位置: 打开 ...
相关推荐
在Android中,TextView可以有以下几种状态: 1. 默认状态(default):当TextView没有任何特殊状态时,即处于默认状态。 2. 选中状态(selected):用户点击或触摸TextView时,它会处于选中状态。 3. 聚焦状态...
TextView是Android中最常用的用于显示文本的控件之一。而Paint对象则是用来控制文本绘制方式的对象,包括颜色、字体大小、样式等等。 1. **TextView**: TextView用于显示文本信息,可以通过多种属性来自定义其外观...
在XML布局文件中,这可以通过`android:text`属性完成: ```xml <TextView android:id="@+id/textView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="这里是一段很...
在XML布局文件中,我们可以分别通过`android:paddingTop`、`android:paddingBottom`、`android:marginTop`和`android:marginBottom`属性来设置这些值。 描述中提到,这个压缩包可能包含一些源码示例,但并未保证...
通过以上分析,我们可以了解到如何在Android中自定义TextView以取消自动换行,并利用自定义属性来灵活控制这一行为。这不仅有助于实现独特的文本显示效果,还能提高代码的可复用性和可扩展性。在实际开发中,根据...
在Android中,可以使用`Html.fromHtml()`方法将HTML字符串转换为可以在`TextView`中显示的格式。例如: ```java String html = "<b>Hello, World!</b>"; TextView tv = (TextView) findViewById(R.id.text_view)...
在XML布局文件中,可以通过以下方式设置`transcriptMode`: ```xml android:id="@+id/listView" android:layout_width="match_parent" android:layout_height="match_parent" android:transcriptMode=...
本篇文章将详细讲解如何在Android中实现TextView的垂直滚动效果。 首先,要开启TextView的滚动功能,我们需要在XML布局文件中设置`android:scrollbars`属性。将其值设为`"vertical"`,即可启用垂直滚动条。例如: ...
在Android开发中,实现TextView的上下滚动效果可以让信息在有限的空间内持续展示,提升用户体验。以下将详细讲解如何实现这一功能。 首先,我们要明白TextView是Android SDK中的一个基础组件,用于显示单行或多行...
在XML布局文件中,也可以通过设置`android:drawableLeft`、`android:drawableTop`等属性来直接指定TextView的图像。 请注意,加载图片时要考虑到性能优化,避免内存泄漏和OOM错误。可以使用`BitmapFactory.Options...
- 在XML布局文件中使用`JustifyTextView`替换原生的`TextView`,并设置相应的属性,如: ```xml android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/your_...
本篇文章将详细介绍如何在Android中实现TextView的无焦点跑马灯和水平滚动效果。 首先,我们需要理解TextView的基础属性。`android:singleLine`属性用于将文本限制为一行,`android:ellipsize`属性则控制当文本超出...
本篇将深入探讨如何在Android中实现这样的功能。 首先,我们需要一个自定义的`ExpandableTextView`类,它扩展了`TextView`并添加了折叠/展开的功能。这个类通常会包含以下几个核心方法: 1. **设置初始状态**:`...
在Android开发中,TextView是用于显示文本的基本组件。在许多应用中,我们可能需要在TextView中展示带有可点击链接的文本,例如网址或电话号码。本文将深入探讨如何在Android的TextView中实现这些链接功能,包括打开...
总结来说,Android中使用XML文件定义颜色资源是一种规范且灵活的方法,它能帮助开发者更好地组织和重用颜色信息。通过在`colors.xml`中定义颜色,然后在布局文件、`drawable`资源或代码中引用,可以提高代码的可读性...
除了在Java代码中设置监听器,你也可以在布局XML文件中使用`android:onClick`属性指定点击事件的处理方法。但这需要你在对应的Activity或Fragment中声明该方法。 ```xml <TextView android:id="@+id/my_text_view...
TextView在XML布局文件中定义,通过`<TextView>`标签,并可以通过`android:text`属性设置初始文本。在代码中,可以通过`setText()`方法动态改变文本内容。然而,它默认会一次性显示所有文本,不会逐行逐字显示。 要...
在Android中,我们可以使用`android.view.animation`包下的动画类来实现这一效果。常见的翻转动画有两种:一种是从正面翻转到反面,另一种是从反面翻转回正面。这通常通过改变视图的旋转角度来实现,如设置初始角度...
5. **布局中使用**:在XML布局文件中,你可以像普通`TextView`一样使用自定义的`ShimmerTextView`,并根据需要设置属性。 接下来是`ShimmerLibrary`。这可能是一个第三方的Shimmer库,提供了更丰富的功能和自定义...
在XML布局文件中定义,或者在代码中创建,TextView可以用来显示静态文本,也可以动态加载数据。 2. **显示HTML内容**: - Android的TextView默认并不支持HTML解析,但通过`Html.fromHtml()`方法,我们可以将HTML...