【发布时间】:2014-08-15 19:53:55
【问题描述】:
在 Table 行下的 TableLayout 中,我创建了两个 TextViews,但是当我运行应用程序时,我的文本没有被放入表格列中,而是被超出并且部分文本不可见。
我的安卓代码如下:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/top_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/shadow_layout"
android:padding="6dip"
android:layout_margin="10dp">
<TableLayout
android:id="@+id/orgSummary_table"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/orgSummary_image"
android:layout_alignStart="@+id/orgSummary_image">
<TableRow
android:id="@+id/orgSummary_tb_founded"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/orgSummary_tr1_founded"
android:textSize="@dimen/subtitle_text"
android:gravity="top"
android:text="Founded"
android:textColor="#d4fff700"
android:paddingLeft="30dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/orgSummary_tr2_founded"
android:textSize="@dimen/subtitle_text"
android:gravity="top"
android:textColor="#d4fff700"
android:paddingLeft="50dp"/>
</TableRow>
</TableLayout>
</RelativeLayout>
从我的活动中,我正在调用代码并将文本设置在第二列 ((TextView)findViewById(R.id.orgSummary_tr2_founded)).setText("一些长文本");
但只有部分文字可见
【问题讨论】: