android - 文本与设计中提到的图像对齐 - Android

标签 android android-layout textview

我想在 android 上实现以下设计,D 是图像或字符。文本应按照设计中所述正确对齐。有什么建议吗?

enter image description here

我尝试使用 TextView 的左侧可绘制对象、单选按钮和复选框的自定义图标,但文本对齐是个问题。 提前致谢。

最佳答案

试试这个,它会给你同样的结果

https://github.com/rpradal/Lettrine

在你的gradle中添加这个

compile 'com.github.rpradal.lettrine:lettrine:release_number'

在您的 XML 中只需添加

<com.github.rpradal.lettrine.LettrineTextView
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              app:lettrine_textColor="@android:color/holo_red_dark"
              app:lettrine_text="Lorem ipsum"
              app:lettrine_lettrineSize="3"
              app:lettrine_textSize="14sp" />

enter image description here

关于android - 文本与设计中提到的图像对齐 - Android,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42342127/

相关文章:

android - 下划线 TextView

android - 使用 NestedScrollView 内的 Viewpager 折叠工具栏布局

android - 使用 Android 编译较新版本的 FFMPEG

java - Kotlin Koans 与 EduTools 插件 : "Failed to launch checking"

android - 布局在 StatusBar 和 Soft Keys 下

android - android中的语音录制ui

java - 使用 libgdx 渲染游戏时出现问题

android - 如何在 ConstraintLayout 中将布局的所有内容置于中心

Android TextView 密码在 Lollipop 上被破解

android - getChildCount() 返回错误的子级数