运行应用程序时如何使TextView出现?
运行应用程序时我的文本视图不会出现。我尝试调整可见度和高程。我在网上看,答案都没有。 我该如何解决? (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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论