我想创建一个布局,将图像的顶部与TextView的顶部对齐,如下所示:
--------- Text text text text text text text
| Image | text text text text text text text
--------- text text text text text text text
text text text text text text text
text text text text text.
Run Code Online (Sandbox Code Playgroud)
我尝试通过设置android:drawableLeft我的图像来做到这一点,但是它将图像垂直居中:
Text text text text text text text
--------- text text text text text text text
| Image | text text text text text text text
--------- text text text text text text text
text text text text text. …Run Code Online (Sandbox Code Playgroud) <TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawablePadding="@dimen/padding_small_6"
android:includeFontPadding="false"
android:text="@string/forgot_password_hint"
android:drawableStart="@drawable/ic_edit"
android:textSize="@dimen/text_size_medium_14"/>
Run Code Online (Sandbox Code Playgroud)
这是我的文本视图。我想将可绘制对象设置在此文本视图的左侧。但问题是,如果文本是多行的,则可绘制对象在文本视图中显示为中心垂直。
是否有任何选项可以在文本视图的左上角设置可绘制对象?