Framelayout does not show my TextViews

0

My Framelayout has not bugged and is no longer showing data I received from Json on my TexView in the Header section. Even though I adding a text it does not show anything.

  • XML:

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">
    
        <ImageView
            android:id="@+id/imageView_header_book"
            android:layout_width= "match_parent"
            android:layout_height="84dp"
            android:layout_marginBottom="410dp"
            android:layout_gravity="center_horizontal"
            android:scaleType="fitXY"
            android:src="@drawable/header_book"/>
    
        <TextView
            android:id="@+id/custom_view_loja"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="260dp"
            android:gravity="center_horizontal|center_vertical"
            android:layout_gravity="center_horizontal|center_vertical"
            android:maxLines="2"
            android:textColor="@color/white"
            android:textSize="@dimen/overlay_loja"
            android:textStyle="bold"
            android:shadowColor="@color/black"
            android:shadowDx="1"
            android:shadowDy="1"
            android:shadowRadius="2"/>
    
        <TextView
            android:id="@+id/custom_view_shopping"
            android:layout_width="100dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal|center_vertical"
            android:gravity="center_horizontal|center_vertical"
            android:layout_marginBottom="245dp"
            android:shadowColor="@color/black"
            android:shadowDx="1"
            android:shadowDy="1"
            android:shadowRadius="2"
            android:singleLine="true"
            android:textColor="@color/white"
            android:textSize="@dimen/overlay_shopping" />
    
        <TextView
            android:id="@+id/custom_view_competencia"
            android:layout_width="100dp"
            android:layout_height="wrap_content"
            android:layout_marginBottom="219dp"
            android:layout_gravity="center_horizontal|center_vertical"
            android:gravity="center_horizontal|center_vertical"
            android:singleLine="true"
            android:textColor="@color/white"
            android:textSize="@dimen/overlay_competencia"
            android:shadowColor="@color/black"
            android:shadowDx="1"
            android:shadowDy="1"
            android:shadowRadius="2"/>
    </FrameLayout>
    
    <LinearLayout
        android:id="@+id/custom_view_information_container"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:orientation="vertical"
        android:paddingRight="30dp" >
    
        <LinearLayout
            android:id="@+id/custom_view_book_horizontal"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal" >
    
            <LinearLayout
                android:id="@+id/custom_view_book_text_data"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="vertical" >
    
                <FrameLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">
    
                    <ImageView
                        android:id="@+id/imageView_aluguel_shopping"
                        android:layout_width="35dp"
                        android:layout_height="40dp"
                        android:layout_marginTop="100dp"
                        android:layout_marginLeft="25dp"
                        android:layout_gravity="left"
                        android:src="@drawable/aluguel_shopping" />
    
                    <TextView
                        android:id="@+id/textView_aluguel_icon_title"
                        android:layout_width="wrap_content"
                        android:layout_height="14dp"
                        android:layout_marginLeft="23dp"
                        android:layout_marginTop="140dp"
                        android:gravity="left"
                        android:text="Aluguel"
                        android:textColor="@color/black"
                        android:textSize="@dimen/overlay_aluguel_icon"
                        android:textStyle="bold"/>
    
                    <TextView
                        android:id="@+id/custom_view_valor_aluguel"
                        android:layout_width="50dp"
                        android:layout_height="wrap_content"
                        android:layout_gravity="left"
                        android:layout_marginTop="155dp"
                        android:layout_marginLeft="15dp"
                        android:gravity="center_horizontal"
                        android:singleLine="true"
                        android:text="R$ 1.000.000"
                        android:textColor="@color/black"
                        android:textSize="@dimen/overlay_valorAluguel"
                        android:textStyle="bold"/>
    
                    <ImageView
                        android:id="@+id/imageView_venda_shopping"
                        android:layout_width="35dp"
                        android:layout_height="40dp"
                        android:layout_marginTop="100dp"
                        android:layout_gravity="right"
                        android:src="@drawable/venda_shopping" />
    
    
                    <TextView
                        android:id="@+id/textView_vendas_icon_title"
                        android:layout_width="wrap_content"
                        android:layout_height="14dp"
                        android:layout_marginLeft="142dp"
                        android:layout_marginTop="140dp"
                        android:gravity="right"
                        android:text="Venda"
                        android:textColor="@color/black"
                        android:textSize="@dimen/overlay_venda_icon"
                        android:textStyle="bold"/>
    
                    <TextView
                        android:id="@+id/custom_view_valor_venda"
                        android:layout_width="50dp"
                        android:layout_height="wrap_content"
                        android:layout_gravity="right"
                        android:layout_marginTop="155dp"
                        android:gravity="right"
                        android:singleLine="true"
                        android:text="R$1.000.000"
                        android:textColor="@color/black"
                        android:textSize="@dimen/overlay_valorVenda"
                        android:textStyle="bold"/>
                </FrameLayout>
    
                <TextView
                    android:id="@+id/custom_view_valor_aluguelMensal"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_gravity="left"
                    android:layout_marginTop="3dp"
                    android:singleLine="true"
                    android:textColor="@color/black"
                    android:textSize="@dimen/overlay_valorAluguelMensal" />
    
                <TextView
                    android:id="@+id/custom_view_valor_aluguelAnual"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_gravity="left"
                    android:layout_marginTop="3dp"
                    android:singleLine="true"
                    android:textColor="@color/black"
                    android:textSize="@dimen/overlay_valorAluguelAnual" />
    
    
                <TextView
                    android:id="@+id/custom_view_valor_vendaMensal"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_gravity="left"
                    android:layout_marginTop="3dp"
                    android:singleLine="true"
                    android:textColor="@color/black"
                    android:textSize="@dimen/overlay_valorVendaMensal" />
    
                <TextView
                    android:id="@+id/custom_view_valor_vendaAnual"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_gravity="left"
                    android:layout_marginTop="3dp"
                    android:singleLine="true"
                    android:textColor="@color/black"
                    android:textSize="@dimen/overlay_valorVendaAnual" />
    
                <TextView
                    android:id="@+id/badge_custoOcupacao_valor"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dp"
                    android:gravity="center_horizontal"
                    android:textColor="@color/black"
                    android:textSize="@dimen/overlay_custoOcupacao_valor"
                    android:textStyle="bold" />
    
            </LinearLayout>
        </LinearLayout>
    </LinearLayout>
    
    <FrameLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignRight="@id/custom_view_book_background"
        android:layout_below="@id/custom_view_information_container" >
    
        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:orientation="vertical"
            android:rotation="20" >
        </LinearLayout>
    </FrameLayout>
    

asked by anonymous 26.06.2017 / 21:01

2 answers

1

The namespace in your FrameLayout is probably missing

<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    
26.06.2017 / 21:32
0

I was able to solve my problem.

  • What was happening was this: I've added the following tag in a TextView and ImageView , however for some reason it " buga " layout and the issues I mentioned in the question .

So just remove the :

android:gravity="center_horizontal|center_vertical"
    
27.06.2017 / 15:17