【问题标题】:Creating table Android创建表Android
【发布时间】:2016-11-16 04:27:28
【问题描述】:
<TableLayout android:layout_width="match_parent" android:id="@+id/tableLayout1" android:layout_height="wrap_content" android:stretchColumns="1">
<TableRow android:id="@+id/tableRow1" android:layout_width="wrap_content" android:layout_height="wrap_content">
    <TextView android:text="my name is Tarzan and i lives in Amazon Jungle. I want an android phone." android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
    <TextView android:text="my name is Mowgly and i lives in Amazon Jungle. I want an android phone." android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
</TableRow>

我有一个包含两列的表格,我在两列中都放置了 TextViews.. 我拉伸了第二列.. 但是,当我在两个 TextViews 中设置长文本时,表格超出了电话的限制,所以我不能看到了.. 如果我用android:layout_width="fill_parent" 设置表格布局也是一样的.. 我该怎么办?

【问题讨论】:

  • 你想要什么,如果文字很长,应该怎么显示?

标签: android android-tablelayout


【解决方案1】:

android:maxWidth="100dip".. 在你的 textView 中添加这样的标签..

【讨论】:

    猜你喜欢
    • 2012-04-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多