视图不相对布局中显示 [英] A view does not show inside a relative layout
本文介绍了视图不相对布局中显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有这样的布局有问题,我无法找出什么是错的。 正如你所看到的,有一个天文台表和相对布局中的表格,但计时表没有显示,甚至没有一个空格。
I have a problem with this layout and i cannot find out what is wrong. As you can see, there is a chronometer and a table inside a relative layout but the chronometer does not show, not even a blank space.
<?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>
什么想法?
推荐答案
我终于得到了显示天文台表的方式。 谢谢大家谁试图帮助我,答案是非常接近我的解决方案是:
finally i got the way to display the chronometer. Thanks to everyone who tried to help me, the answers were really close to my solution which is:
<Chronometer
android:id="@+id/chrono"
android:textColor="#4169E1"
android:textSize="20sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="Chronometer"
/>
<TableLayout
android:id="@+id/parentLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/chrono"
>
这篇关于视图不相对布局中显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文