熟悉com.github.johnkil.print.PrintView请看下,简单

czx_china 2018-11-28 01:50:31
<com.github.johnkil.print.PrintView
android:layout_alignParentLeft="true"
android:id="@+id/arrow_icon"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:iconText="@string/ic_keyboard_arrow_right"
app:iconColor="@color/text_gray"
app:iconFont="fonts/material-icon-font.ttf"
app:iconSize="20dp" />

app:iconText="@string/ic_keyboard_arrow_right" 我在改这句换成drawable文件夹里的图标?
icon.setIconText(context.getResources().getString(R.string.ic_sd_storage))
这句怎么搞用R.drawable.ic_sd代替?
...全文
380 1 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
mayuoy 2019-01-11
  • 打赏
  • 举报
回复
com.github.johnkil.print.PrintView 是使用矢量字体做图标的组件,不能使用 drawable 中的图片图标。
app:iconText="@string/ic_keyboard_arrow_right" 表示字体文件中的一个字体。

如果要使用 drawable 中的图片图标, 可以用 imageView

80,472

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧