2017-09-04 264 views
-1

我的項目中有一些彈出窗口可以完美工作,但這個似乎不起作用,他只顯示按鈕,文字瀏覽不會顯示(對不起,因爲我不想使用)我嘗試使用其他的佈局,但並不好看在所有...我要做的就是在屏幕中間簡單的使用3個textviews,如果你們能幫助我與我會很高興TextView在RelativeLayout中不顯示

popadd.xml

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
android:layout_width="match_parent" android:layout_height="match_parent" 
android:background="@drawable/dialog_round"> 

<ImageButton 
    android:id="@+id/btCancelar" 
    android:layout_width="50dp" 
    android:layout_height="50dp" 
    android:src="@drawable/cancel" 
    android:tint="#ffffff" 
    android:background="@drawable/round_button" 
    android:padding="5dp" 
    android:layout_alignParentBottom="true" 
    android:layout_alignParentRight="true" 
    android:layout_marginBottom="5dp" 
    android:layout_marginRight="90dp" /> 

<ImageButton 
    android:id="@+id/btEnviar" 
    android:layout_width="50dp" 
    android:layout_height="50dp" 
    android:src="@drawable/certo" 
    android:tint="#ffffff" 
    android:background="@drawable/round_button" 
    android:padding="5dp" 
    android:layout_alignParentBottom="true" 
    android:layout_alignParentRight="true" 
    android:layout_marginBottom="5dp" 
    android:layout_marginRight="30dp" /> 

<TextView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="Adicionar amigo" 
    android:textSize="70px" 
    android:textColor="#454545" 
    android:layout_marginTop="190dp" 
    android:layout_centerHorizontal="true"/> 

<TextView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="Enviar solicitação de amizade para" 
    android:textSize="40px" 
    android:textColor="#454545" 
    android:layout_marginTop="240dp" 
    android:layout_centerHorizontal="true"/> 

<TextView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:id="@+id/tvNome" 
    android:text="Carregando..." 
    android:textSize="40px" 
    android:textColor="#454545" 
    android:layout_marginTop="270dp" 
    android:layout_centerHorizontal="true"/> 

</RelativeLayout> 
+0

嘗試設置'android:layout_width =「50dp」 android:layout_height =「50dp」'。 – KeLiuyue

+0

如果我設定我會有一個小球而不是彈出式 – Higor

回答

0

在您的代碼中試試這個。

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
      xmlns:app="http://schemas.android.com/apk/res-auto" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:background="@drawable/dialog_round"> 

<ImageButton 
    android:id="@+id/btCancelar" 
    android:layout_width="50dp" 
    android:layout_height="50dp" 
    android:layout_alignParentBottom="true" 
    android:layout_alignParentRight="true" 
    android:layout_marginBottom="5dp" 
    android:layout_marginRight="90dp" 
    android:background="@drawable/round_button" 
    android:padding="5dp" 
    android:src="@drawable/cancel" 
    android:tint="#ffffff"/> 

<ImageButton 
    android:id="@+id/btEnviar" 
    android:layout_width="50dp" 
    android:layout_height="50dp" 
    android:layout_alignParentBottom="true" 
    android:layout_alignParentRight="true" 
    android:layout_marginBottom="5dp" 
    android:layout_marginRight="30dp" 
    android:background="@drawable/round_button" 
    android:padding="5dp" 
    android:src="@drawable/certo" 
    android:tint="#ffffff"/> 

<LinearLayout 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_centerInParent="true" 
    android:gravity="center" 
    android:orientation="vertical"> 

    <TextView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_centerHorizontal="true" 
     android:text="Adicionar amigo" 
     android:textColor="#454545" 
     android:textSize="70px"/> 

    <TextView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_centerHorizontal="true" 
     android:layout_marginTop="10dp" 
     android:text="Enviar solicitação de amizade para" 
     android:textColor="#454545" 
     android:textSize="40px"/> 

    <TextView 
     android:id="@+id/tvNome" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_centerHorizontal="true" 
     android:layout_marginTop="10dp" 
     android:text="Carregando..." 
     android:textColor="#454545" 
     android:textSize="40px"/> 
</LinearLayout> 
</RelativeLayout> 
+0

就是這樣,謝謝!我只是將android:paddingBottom =「70dp」添加到LinearLayout並且工作正常。 – Higor

+0

我很高興你解決了這個問題。 – KeLiuyue