android - Text View is not visible -


i have textview should visible if particular condition satisfied. other views functioning on satisfaction of condition text view not getting visible.

<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#fff">  <relativelayout     android:id="@+id/nav_header_container"     android:layout_width="match_parent"     android:layout_height="50dp"     android:layout_alignparenttop="true"     android:background="#000">     <textview        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:text="hi "        android:textstyle="bold"        android:layout_centervertical="true"        android:textcolor="#fff"        android:paddingleft="5dp"        android:id="@+id/hi"/>      <textview         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:textcolor="#fff"         android:id="@+id/name"         android:textstyle="bold"         android:layout_centervertical="true"         android:text="!"         android:layout_torightof="@+id/hi"/>     <textview         android:layout_width="wrap_content"         android:layout_height="wrap_content"          android:layout_centervertical="true"         android:textstyle="italic"          android:textcolor="#fff"         android:id="@+id/edit"         android:paddingright="5dp"         android:layout_alignparentright="true"/>  </relativelayout> <android.support.v7.widget.recyclerview     android:id="@+id/drawerlist"     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:layout_below="@id/nav_header_container"     android:layout_margintop="15dp"     />  <textview     android:layout_width="fill_parent"     android:layout_height="wrap_content"     android:id="@+id/hello"     android:text="hello"     android:textcolor="#000"     android:layout_below="@+id/drawerlist"     android:layout_margintop="15dp"     android:paddingleft="5dp"     android:textstyle="italic"/>     </relativelayout> 

text view id=hello not showing up.

this code using-

   if(fname!="!")     {         edit.settext("edit");         hello.setvisibility(view.visible);     }     else     {         edit.settext("what's going on?");         hello.setvisibility(view.gone);     } 

change recyclerview , textview attributes - make recyclerview layout_above of textview, not textview below recyclerview.

also layout_alignparentbottom="true" must added textview.

<android.support.v7.widget.recyclerview     android:id="@+id/drawerlist"     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:layout_below="@id/nav_header_container"     android:layout_above="@+id/hello"     android:layout_margintop="15dp" />  <textview     android:id="@+id/hello"     android:layout_width="fill_parent"     android:layout_height="wrap_content"     android:layout_margintop="15dp"     android:paddingleft="5dp"     android:text="hello"     android:layout_alignparentbottom="true"     android:textcolor="#000"     android:textstyle="italic" /> 

Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -