Android表:没有可见长文本的ImageView和TextView
我有两列的表格布局。如果TextView中的文本比屏幕大小长,并且有一点点-6或7个符号,则这6或7个符号不可见。如果文字较长且符号较多,则文字可见。它是ListView的一部分,我在ImageView中动态加载文本内容和图像。我希望文本视图中的文本无论多长都始终可见。我能做什么 以下是我的布局xml内容:Android表:没有可见长文本的ImageView和TextView,android,text,textview,long-integer,Android,Text,Textview,Long Integer,我有两列的表格布局。如果TextView中的文本比屏幕大小长,并且有一点点-6或7个符号,则这6或7个符号不可见。如果文字较长且符号较多,则文字可见。它是ListView的一部分,我在ImageView中动态加载文本内容和图像。我希望文本视图中的文本无论多长都始终可见。我能做什么 以下是我的布局xml内容: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schem
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<TableLayout
android:id="@+id/message_table_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:stretchColumns="1"
>
<TableRow>
<ImageView
android:id="@+id/message_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
/>
<TextView
android:id="@+id/message_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Technical Support Representative"
android:layout_below="@+id/message_image"
android:layout_gravity="center_vertical"
/>
</TableRow>
</TableLayout>
</RelativeLayout>
这是我的文字:
String messageTitleText = "<b> Xxxxxxx xxx xxx xx<br/> Xxxxxxxxxx<br/> Xxxxxxxxxxx<br/> xxxxxxxxxxxxxxxx<br/> xxx xxxxxxxxx x xxxxxxxx xx 1234567890<br/> xxxxxxx xxxx<br/> xxxxxxx xxxx xxxx";
messageTitle.setText(Html.fromHtml(messageTitleText));
String messageTitleText=“Xxxxxxx xxx xxx xxx xx
xxxxxxxxx
Xxxxxxxxxx
xxxxxxxxxxxxxx
xxx xxxxxxxxxxxxx Xxxxxxxxxx 1234567890
xxxxxxxxxxxx;
messageTitle.setText(Html.fromHtml(messageTitleText));
我的HTC在“1234”、“567890”隐藏后不显示字符
谢谢你试试这个
<TextView
android:id="@+id/message_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="4"
android:lines="4"
android:text="Technical Support Representative"
android:layout_below="@+id/message_image"
android:layout_gravity="center_vertical"
/>
现在我用这个,没关系:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<ImageView
android:id="@+id/message_image"
android:layout_gravity="center"
android:layout_width="120px"
android:layout_height="48dp"
android:src="@drawable/ic_launcher" />
<TextView
android:id="@+id/message_title"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView" />
</LinearLayout>
谢谢,它不会生效。TextView中的文本是多行的,仅更改可见行号。请尝试在android:text=“Technical Support Representative”
中添加更多文本,您将看到结果,如android:text=“技术支持代表,技术支持代表,技术支持代表,技术支持代表,技术支持代表…”
添加到我的测试文本中。你看到了吗?它对我很有效。检查此链接我已粘贴我的设备尝试设置安卓:src=“@drawable/ic_launcher“转到ImageView,您将看到问题所在。您没有在ImageView中设置src。