2012-10-08 8 views
0

Dans le morceau de code suivant la disposition linéaire au fond extrême n'est pas visible.I essayé plusieurs méthodes, mais n'a pas pu le faire visible.Please jeter un oeilDisposition linéaire non visible

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="@color/GlobalBG" 
    android:orientation="vertical" > 

    <include 
     android:id="@+id/id_nav_bar" 
     layout="@layout/app_nav_layout" /> 

    <ListView 
     android:id="@+id/id_home_screen_list" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:cacheColorHint="@android:color/transparent" /> 

    <RelativeLayout 
     android:id="@+id/id_linear_layout_system_capacity" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_marginTop="105dip" 
     android:background="@drawable/home_storage_bg" 
     android:orientation="vertical" > 

     <TextView 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:layout_marginTop="40dip" 
      android:gravity="center_horizontal" 
      android:text="Dummy" 
      android:textStyle="bold" /> 

     <LinearLayout 
      android:id="@+id/id_linear_layout_seekbar" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_centerInParent="true" 
      android:background="@drawable/home_seekbar_bg" /> 
    </RelativeLayout> 

    <LinearLayout 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:background="@drawable/home_bottom_bg"/ > 
    </LinearLayout> 

Répondre

0

vous avez mis

android:layout_width="wrap_content" android:layout_height="wrap_content" 

comme wrap_content et il n'y a pas de contenu à l'intérieur de votre mise en page il est donc peut-être pas visible

+0

Ce n'est pas le cas ... la disposition sera visible s'il y a un BG. –

+1

Je l'ai essayé régler la hauteur de TextView comme wrap_content ou d'une hauteur minimale au lieu de fill_parent cela fonctionne – Syn3sthete

+0

@Hari ... Oui qui aide ... Mais il cache le texte dans la vue texte ... Tout indice comment ajuster cela? –

-1

si je comprends bien cette mise en page invisible doit être toujours visible dans le bas de l'écran, puis vous devriez mieux utiliser RelativeLayout insted de LinearLayout Modifier cette mise en page

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:background="@color/GlobalBG" 
android:orientation="vertical" > 

À <RelativeLayout> et définir cette android:layout_alignParentBottom="true" à votre disposition invisible

Modifié: cela fonctionne pour moi

<?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="@color/red" > 

<RelativeLayout 
    android:id="@+id/id_linear_layout_system_capacity" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_marginTop="105dip" 
    android:background="@color/row_base_background_end" 
    android:orientation="vertical" > 

    <TextView 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:layout_marginTop="20dip" 
     android:gravity="center_horizontal" 
     android:text="Dummy" 
     android:textStyle="bold" /> 

    <LinearLayout 
     android:id="@+id/id_linear_layout_seekbar" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_centerInParent="true" 
     android:background="@color/row_base_background_start" /> 
</RelativeLayout> 

<LinearLayout 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignParentBottom="true" 
    android:background="@color/gray" > 
</LinearLayout> 

</RelativeLayout> 
+0

Ne fonctionne même pas en utilisant le défilement Voir –

+0

Cela ne fonctionne pas non plus ... S'il vous plaît arrêter de bluffer ... –

0

Correction du problème en éditant le code comme suit: -

<TextView 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_marginTop="17dip" 
     android:gravity="center_horizontal" 
     android:text="Dummy" 
     android:textStyle="bold" /> 
Questions connexes