运行应用程序时如何使TextView出现?

发布于 2025-01-30 19:27:26 字数 3908 浏览 0 评论 0原文

运行应用程序时我的文本视图不会出现。我尝试调整可见度和高程。我在网上看,答案都没有。 我该如何解决? (java)

这是Android Studio中的渲染

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/cardview_light_background"
    android:elevation="-1dp"
    android:theme="@style/ThemeOverlay.GrubhubWheel.FullscreenContainer">

    <!-- The primary full-screen view. This can be replaced with whatever view
         is needed to present your content, e.g. VideoView, SurfaceView,
         TextureView, etc. -->

    <!-- This FrameLayout insets its children based on system windows using
         android:fitsSystemWindows. -->
    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true">

        <ImageButton
            android:id="@+id/gear"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:backgroundTint="@android:color/transparent"
            android:visibility="visible"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:srcCompat="@drawable/ic_settings_5672"
            tools:ignore="SpeakableTextPresentCheck" />

        <TextView
            android:id="@+id/Blind"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:fontFamily="@font/yaro_st"
            android:textAlignment="center"
            android:textAppearance="@style/TextAppearance.AppCompat.Display3"
            android:textColor="#010101"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            tools:text="Blind" />

        <TextView
            android:id="@+id/Ate"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="32dp"
            android:fontFamily="@font/galano_grotesque_alt_semi_bold"
            android:textAlignment="center"
            android:textAppearance="@style/TextAppearance.AppCompat.Display4"
            android:textColor="#4ca66c"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="@+id/Blind"
            tools:text="Ate" />

        <ImageButton
            android:id="@+id/wheel"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:layout_marginVertical="10dp"
            android:backgroundTint="@android:color/transparent"
            android:elevation="-1dp"
            android:forceHasOverlappingRendering="true"
            android:rotation="15"
            android:scaleType="fitCenter"
            android:visibility="visible"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/Ate"
            app:layout_constraintVertical_bias="0.85"
            app:srcCompat="@drawable/random_wheel"
            tools:ignore="SpeakableTextPresentCheck,ImageContrastCheck" />

    </androidx.constraintlayout.widget.ConstraintLayout>

</FrameLayout>

My text views aren't appearing when running the app. I've tried adjusting the visibility and elevation. I've looked online and none of the answers worked.
How do I fix this? (Java)

This is the render in android studio

This is the emulator, my physical phone shows the same thing

activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/cardview_light_background"
    android:elevation="-1dp"
    android:theme="@style/ThemeOverlay.GrubhubWheel.FullscreenContainer">

    <!-- The primary full-screen view. This can be replaced with whatever view
         is needed to present your content, e.g. VideoView, SurfaceView,
         TextureView, etc. -->

    <!-- This FrameLayout insets its children based on system windows using
         android:fitsSystemWindows. -->
    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true">

        <ImageButton
            android:id="@+id/gear"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:backgroundTint="@android:color/transparent"
            android:visibility="visible"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:srcCompat="@drawable/ic_settings_5672"
            tools:ignore="SpeakableTextPresentCheck" />

        <TextView
            android:id="@+id/Blind"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:fontFamily="@font/yaro_st"
            android:textAlignment="center"
            android:textAppearance="@style/TextAppearance.AppCompat.Display3"
            android:textColor="#010101"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            tools:text="Blind" />

        <TextView
            android:id="@+id/Ate"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="32dp"
            android:fontFamily="@font/galano_grotesque_alt_semi_bold"
            android:textAlignment="center"
            android:textAppearance="@style/TextAppearance.AppCompat.Display4"
            android:textColor="#4ca66c"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="@+id/Blind"
            tools:text="Ate" />

        <ImageButton
            android:id="@+id/wheel"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:layout_marginVertical="10dp"
            android:backgroundTint="@android:color/transparent"
            android:elevation="-1dp"
            android:forceHasOverlappingRendering="true"
            android:rotation="15"
            android:scaleType="fitCenter"
            android:visibility="visible"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/Ate"
            app:layout_constraintVertical_bias="0.85"
            app:srcCompat="@drawable/random_wheel"
            tools:ignore="SpeakableTextPresentCheck,ImageContrastCheck" />

    </androidx.constraintlayout.widget.ConstraintLayout>

</FrameLayout>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文