https://github.com/niniloveyou/drawabletextview
自定义控件 :drawable 跟随TextView居中 The drawable follows the text centered
https://github.com/niniloveyou/drawabletextview
drawable textview
Last synced: about 1 year ago
JSON representation
自定义控件 :drawable 跟随TextView居中 The drawable follows the text centered
- Host: GitHub
- URL: https://github.com/niniloveyou/drawabletextview
- Owner: niniloveyou
- License: apache-2.0
- Created: 2017-01-20T03:08:12.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-05T07:17:56.000Z (almost 9 years ago)
- Last Synced: 2025-03-28T23:11:15.558Z (about 1 year ago)
- Topics: drawable, textview
- Language: Java
- Homepage:
- Size: 124 KB
- Stars: 139
- Watchers: 7
- Forks: 46
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DrawableTextView
自定义控件 :drawable 跟随TextView居中
The drawable follows the text centered
截图:
----------

###Manually
你只需要这添加这两个文件就可以使用了!
+ deadline/DrawableTextView.java
+ res/values/attrs.xml
###代码中这样设置即可
```
drawable = ContextCompat.getDrawable(getContext(), R.mipmap.xxx);
setDrawable(DrawableTextView.LEFT, drawable, width, height);
```
Customizable attributes
### xml中定义了以下属性
- Define `xmlns:app="http://schemas.android.com/apk/res-auto"` on root of your xml file
```xml
```
Developed By
-------
deadline
Blog : http://www.jianshu.com/users/25e80ace21b8/latest_articles