【发布时间】:2011-03-05 07:39:34
【问题描述】:
我想在表格的左侧单元格中显示图像,在右侧单元格中显示文本。
我的问题是文本视图浮动在可见屏幕之外,所以我看不到整个文本。文本应在屏幕可见的右端中断。我尝试使用像素值设置maxWidth,但这不起作用。
谁能为我的问题提供解决方案。也许有更好的布局选项?
我的布局定义:
<TableRow>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:tint="#55ff0000"
android:src="@drawable/bla"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/aboutblaImageText"
android:textSize="6pt"
android:textColor="#FFF"
android:maxWidth="100px"
/>
</TableRow>
【问题讨论】:
-
好的,解决方案似乎是使用嵌套的线性布局(外部线性布局垂直,内部线性布局水平)。阅读有关性能不佳但有效的信息
-
这是最好的解决方案,嵌套到线性布局中。
-
您能否详细说明嵌套线性布局的含义?您是否将 tablerow 中的每个元素都包装在自己的布局中?
标签: android tablelayout