使用TextView/EditText应该注意的地方

本文主要探讨了在Android开发中使用TextView和EditText时需要注意的关键点,包括但不限于输入验证、用户体验和性能优化等方面。
摘要由CSDN通过智能技术生成
https://github.com/bufferapp/BufferTextInputLayout

ZamanTextView
https://github.com/Morxander/Zaman
Text Decorator
https://github.com/nntuyen/text-decorator
Build valid HTML for Android TextView.
https://github.com/jrummyapps/html-builder
Buffer Text Input Layout
https://github.com/bufferapp/BufferTextInputLayout

Android复制TextView内容常用方法汇总
http://www.open-open.com/lib/view/open1482202862623.html

TextJustify是对安卓TextView控件的格式优化,TextView在显示文字的时候往往在一行的中间部分就跳到了下一行,看起来很杂乱,尤其是在显示英文的时候,TextJustify解决了这个问题。
https://github.com/bluejamesbond/TextJustify-Android

An Android library that allows you to build text layouts more easily.
https://github.com/facebookincubator/TextLayoutBuilder

可以显示 Markdown 格式文本的自定义WebView
https://github.com/falnatsheh/MarkdownView

PinchZoomTextView
https://github.com/androidessence/PinchZoomTextView

emoji表情
https://github.com/rockerhieu/emojiconize

支持Android图文混排、文字环绕图片等效果
http://www.jcodecraeer.com/a/opensource/2015/0821/3339.html

各种文字效果的动画框架
http://www.jcodecraeer.com/a/opensource/2015/1016/3587.html

根据宽度高度自适应文字大小,如果textview宽度太窄了,字体会自动变小
http://www.23code.com/autoscaletextview/

CreditCardEntry实现信用卡或银行卡号数字每四位数字分隔
http://www.23code.com/creditcardentry/

IconicDroid实现图形文字,可以像设置文字一样,设置图标大小和颜色。
http://www.23code.com/iconicdroid/

Emojicon
支持emojis的TextView和EditText
项目地址:https://github.com/rockerhieu/emojicon

AutoFitTextView
可固定边界内容字体大小自适应的TextView
项目地址: https://github.com/grantland/android-autofittextview

Shimmer for Android
文字发淡光的TextView
项目地址: https://github.com/RomainPiel/Shimmer-android

JumpingBeans
文字像 Mexican beans 一样跳动
项目地址: https://github.com/frakbot/JumpingBeans

ExpandableTextView
http://www.23code.com/expandabletextview/
https://github.com/borjabravo10/ReadMoreTextView
http://www.jcodecraeer.com/a/opensource/2016/0824/6561.html

Android中为TextView添加多个可点击的文本
http://blog.csdn.net/bboyfeiyu/article/details/39051521

Android TextView中实现点击文本超链接(无下划线)的封装类
http://blog.csdn.net/bboyfeiyu/article/details/38734103

Android开发技巧——去掉TextView中autolink的下划线
http://blog.csdn.net/maosidiaoxian/article/details/39156563

带清除功能的输入框控件ClearEditText,仿IOS的输入框

Android文本框编辑的浮动提示:FloatLabeledEditText
http://www.open-open.com/lib/view/open1414653003809.html
http://www.open-open.com/lib/view/open1409302010353.html




Advanced Android TextView
https://github.com/chiuki/advanced-textview
Animated CompoundDrawable
Text shadow
Custom font
Gradient text
Patterned text
HTML.fromHtml()
setFontFeatureSettings()
Styled string
AlignmentSpan
ClickableSpan
Rainbow span, animated
Lined paper
Emoji

EditText小记
http://www.cnblogs.com/endure/p/3690443.html

Android字体阴影
更多阴影:
http://chiuki.github.io/advanced-android-textview/#/7




Shader shader = new LinearGradient(
    0, 0, 0, textView.getTextSize(),
    Color.RED, Color.BLUE, Shader.TileMode.CLAMP);
textView.getPaint().setShader(shader);





Bitmap bitmap = BitmapFactory.decodeResource(
    getResources(), R.drawable.cheetah_tile);
Shader shader = new BitmapShader(bitmap, 
    Shader.TileMode.REPEAT, Shader.TileMode.REPEAT);
textView.getPaint().setShader(shader);





strings.xml文件定义字符串中的标签
Android TextView 自动换行问题

关于android软键盘enter键的替换与事件监听
软件盘的界面替换只有一个属性android:imeOptions,这个属性的可以取的值有normal,actionUnspecified,actionNone,actionGo,actionSearch,actionSend,actionNext,actionDone,例如当值为actionNext时enter键外观变成一个向下箭头,而值为actionDone时enter键外观则变成了“完成”两个字。
我们也可以重写enter的事件,方法如下:

TextView editText = new TextView(this);
editText.setOnEditorActionListene(
newTextView.OnEditorActionListener() {   
          public boolean onEditorAction(TextView v, int actionId,   
                            KeyEvent event){   
                        if (actionId == EditorInfo.IME_ACTION_SEND)   
                        {   
                            // 在这里编写自己想要实现的功能   
                        }   
                        return false;   
          }   
}); 

另附: 拦截HOME按键

Android如何显示音标
http://marshal.easymorse.com/archives/4087

EditText设置光标颜色
android:textCursorDrawable="@null"

EditText设置光标位置问题
EditText中有一些预置文本的时候,想把光标调到最前面,一开始是使用的setSelection(0),结果发现在三星P1000上面有问题。经过研究发现需要先调用EditText.requestFocus(),再调用setSelection(0)。否则的话,在2
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值