Android的 - 如何显示带图标的4个文本的意见? [英] Android - How to display 4 text views with Icons?

查看:123
本文介绍了Android的 - 如何显示带图标的4个文本的意见?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要显示4文本与酷似显示在这个屏幕显示图像:

I want to display 4 texts with images exactly like showed in this screenshot:

注意在图像的BUTTOM 4文本,与图标的旁边。

Notice the 4 texts at the buttom of the image, with the icons next to them.

我的问题是我怎么办呢,我的意思是,我怎么重视每个文本字段的图标,并在页面的底部对称地显示出来。

My question is how do I do it, I mean, how do I attach an icon to each text field and display it symmetrically at the bottom of the page.

我想用图标酷似这个例子来定位我的文字。

I want to position my texts with the icons exactly like this example.

您的帮助谢谢,这是一个新手一个真正伟大的练习:)

Thanks for your help, it's a really great exercise for a newbie :)

Dvir

推荐答案

使用 drawableLeft

<TextView

        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:drawableLeft="@drawable/icon_1"
        android:gravity="center_vertical"
        android:textStyle="bold"
        android:textSize="24dip"
        android:maxLines="1"
       />

在Java的code

In java code

TextView textView = (TextView) findViewById(R.id.yourTV);
textView.setCompoundDrawablesWithIntrinsicBounds(R.drawable.icon_1, 0, 0, 0);

这篇关于Android的 - 如何显示带图标的4个文本的意见?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆