【发布时间】:2014-06-12 11:35:02
【问题描述】:
我的布局有问题,我无法找出问题所在。 如您所见,相对布局中有一个计时器和一个表格,但计时器没有显示,甚至没有空格。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/firstLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<Chronometer
android:id="@+id/chrono"
android:textColor="#4169E1"
android:textSize="20sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/parentLayout"
android:layout_centerHorizontal="true"
android:text="Chronometer"
/>
<TableLayout
android:id="@+id/parentLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
</TableLayout>
</RelativeLayout>
有什么想法吗?
【问题讨论】:
-
让你的表格布局高度为 wrap_content
-
只需将
Chronometer的位置更改为最后一个声明,我的意思是先写TableLayout然后Chronometer -
谢谢大家的建议,但我相信问题出在其他地方,因为我尝试了你所说的一切,但没有。我发布了一个新主题。stackoverflow.com/questions/24201301/…
标签: android view android-relativelayout