2014-02-27 67 views
0

我希望我的TextView覆盖实例中的整个屏幕并覆盖该XML文件中的所有组件。我怎样才能做到这一点?我希望文本视图覆盖整个屏幕

我尝试了将fill_parent设置为android:layout_widthandroid:layout_height,但它不起作用。

+4

发表您的布局XML。 –

+0

我看到它是一个重复的问题。你也提前半小时问过同样的问题。请耐心等待,有时你会迟到回应:) –

回答

0

这很可能是您在父级中设置了填充。 match_parent是多了几分现代:)

1
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    tools:context=".MainActivity" > 

    <TextView 
     android:id="@+id/textView1" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:layout_alignParentBottom="true" 
     android:layout_centerHorizontal="true" 
     android:layout_marginBottom="fill_parent" 
     android:text="TextView" /> 

</RelativeLayout> 

enter image description here

相关问题