简体   繁体   English

我希望文本视图能覆盖整个屏幕

[英]I want text view to cover whole Screen

I want my TextView to Cover the whole screen in a instance and override all the components in that XML file. 我希望TextView能够覆盖实例中的整个屏幕,并覆盖该XML文件中的所有组件。 How can I do this? 我怎样才能做到这一点?

I have tried by setting fill_parent to both android:layout_width and android:layout_height but it does not work. 我尝试通过将fill_parent设置为android:layout_widthandroid:layout_height来尝试,但是它不起作用。

<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>

在此处输入图片说明

It's likely that you have padding set in the parent. 您的父级中可能设置了填充。 match_parent is a little more modern :) match_parent更现代一些:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使视图覆盖整个屏幕? - How to make the View to cover the whole screen? 我希望我的 Android Fragment 覆盖 MainActivity 屏幕(我不想看到任何 MainActivity 文本、按钮等) - I want my Android Fragment to cover the MainActivity screen (I don't want to see any MainActivity text, buttons, etc.) 我希望将网格视图作为一个整体显示 - I want grid view to be displayed as a whole 除了某些元素,如何通过透明视图(alpha为80%)覆盖整个屏幕? - How to cover the whole screen by transparent view (alpha 80%), except for some elements? 如何创建一个不能覆盖整个屏幕的片段 - How to create a fragment that does not cover the whole screen Android GridLayout-以编程方式覆盖整个屏幕 - Android GridLayout- cover whole screen programmatically 为什么GridLayout可以覆盖整个屏幕? - Why does the GridLayout cover the whole screen? 如何创建可响应的GridView以覆盖整个屏幕? - How to create responsive GridView to cover whole screen? libgdx getHeight()不会覆盖整个屏幕 - libgdx getHeight() does not cover the whole screen 如何在 Jetpack Compose 中使底片覆盖整个屏幕 - How do I make Bottom Sheet cover whole screen in Jetpack Compose
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM