Adding text to the layout?

I have a layout for a small screen in a landscape. I have text in a TextView in the layout ... but it does not appear . I did not determine the font size of the text and did not set any parameters. However, the text of the text is not displayed:

<LinearLayout android:layout_width="wrap_content"
    android:id="@+id/text_container"
    android:layout_height="wrap_content"
    android:layout_above="@+id/relativeLayout"
    android:layout_centerHorizontal="true"
    android:layout_marginBottom="25dp">


    <TextView
        android:layout_width="match_parent"
        android:text="20:00"
        android:layout_height="match_parent"
        />


</LinearLayout>

However, the TextView is empty ... Here is an image showing the design layout screen:

enter image description here

Here you can see that the text is clearly set:

enter image description here

Why is the text not displayed? This is very strange, and I tried a lot of things, but the problem persists. I tried:

  • Restart Android Studio
  • Design update
  • Assembly → Clear Project
  • Assembly → Restructuring Project

However, the problem persists. I appreciate your help in solving this problem.

Strange, this is only for landscape layout. It works great in regular layout and layout. This is the same code ...

+4
2

, textColor.

android:textColor="#00FF00"
android:layout_width="fill_parent"
android:layout_height="wrap_content"

 android:layout_marginBottom="25dp"

layout_marginBottom . 25dp . .

+3

match_parent - , textview , / , Textview wrap_content

0

Source: https://habr.com/ru/post/1620062/


All Articles