drawable跟随TextView居中.zip
你只需要这添加这两个文件就可以使用了! 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 <deadline.DrawableTextView android:layout_width="100dp" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:drawablePadding="5dp" app:bottomDrawable="@mipmap/camera" app:bottomDrawableHeight="20dp" app:bottomDrawableWidth="20dp" app:leftDrawable="@mipmap/camera" app:leftDrawableHeight="20dp" app:leftDrawableWidth="20dp" app:rightDrawable="@mipmap/camera" app:rightDrawableHeight="20dp" app:rightDrawableWidth="20dp" app:topDrawable="@mipmap/camera" app:topDrawableHeight="20dp" app:topDrawableWidth="20dp"/>
- 1
- 粉丝: 1593
- 资源: 1099
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助