相关疑难解决方法(0)

将图像顶部对齐到TextView顶部

我想创建一个布局,将图像的顶部与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)

android vertical-alignment textview drawable android-layout

38
推荐指数
1
解决办法
2万
查看次数

如何将复合drawable放在文本视图的左上角

我们可以为textview设置复合drawables,如下所示使用drawableLeft 或者setCompundDrawables使用它只能将drawable放在left/right/top/bottom.But我想把drawables只放在Textview的左上角和右上角.我怎样才能做到这一点 ?

android textview drawable compound-drawables

5
推荐指数
0
解决办法
5924
查看次数