In Android, how can you add a border around a text? I want a border around the text in TextView not around the TextView.Is there any way to do it in? If so, please point me to the proper steps needed to do..
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
Android does not have such feature originally. A few months ago, I had to develop a similar feature, and I used some trick. In that case I used the
shadow
attribute. In your case onTextView.onDraw()
callsuper()
two times. Set the typeface to bold and set the color to border color and call one time, and set normal and call second time. That will work.Try this..
and the result is
You can create custom border for text like this..Here is a sample application.
You can create style for this..
Here is sample style for borderline on text..
Style.xml
Apply style on your TextView
You can use any TextEditors to create a border for ur text and you can add to the code