2014-03-29 78 views
0

屏幕的底部部分即使加載也不顯示行。當向上滾動時,行移動到頂部,當適配器失效時,應用程序通過顯示全屏幕可以正常工作。ExpandableListview未完全顯示

這是我使用的佈局。

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:id="@+id/homescreenview" 
android:orientation="vertical" 
> 

<LinearLayout 
    android:id="@+id/homescreenmainlayout" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical"> 

<LinearLayout 
     android:id="@+id/internetstatus" 
     android:layout_width="match_parent" 
     android:layout_height="30dp" 
     android:gravity="center" 
     android:background="#912E3D"> 

<ImageView 
      android:id="@+id/interneticon" 
      android:layout_width="18dp" 
      android:layout_height="18dp" 
      android:src="@drawable/nonetwork" 
      /> 

<TextView 
      android:id="@+id/internetstatustext" 
      android:layout_toRightOf="@+id/interneticon" 
      android:layout_width="wrap_content" 
      android:layout_height="fill_parent" 
      android:paddingLeft="5dp" 
      android:gravity="center_vertical" 
      android:text="@string/nonetconnection" 
      android:textColor="@color/white" 
      android:textSize="18sp" 
      android:textStyle="italic" 
      /> 

</LinearLayout> 

    <ExpandableListView 
     android:id="@+id/expandableListView" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 

     > 
    </ExpandableListView> 
</LinearLayout> 

附上截圖。

Here leaving empty screen at bottom of screen.

+0

我猜你使用了3個線性佈局,但只關閉了2個,沒有關閉父線性佈局 – Himani

+0

@Venu。這不是問題,我在發帖時忘記關閉。感謝您查看我的信息。 –

+0

你想要3個佈局,一個標題,一個頁腳,並填寫其餘的清單,對不對? –

回答

0

還有一招,以填補在屏幕上的所有空間,試試這個,讓我知道,你應該你的ListView的高度設置爲0dp和weigth至1 ... Android將計算高度自動爲你。

<ExpandableListView 
     android:id="@+id/expandableListView" 
     android:layout_width="match_parent" 
     android:layout_height="0dp" 
     android:layout_weight="1" /> 
+0

這對我不起作用 – NightSkyLove

+0

@NightSkyLove帶着這種詳細的評論......它很難回答。順便說一下,自從我沒有開發Android以來已經有一段時間了,所以也許這種解決方案不是必需的,或者現在採用不同的方法來實現,我建議您提出另一個問題。 –

+0

應用體重基本上對我沒有任何幫助。我遇到了一個問題,我添加了一個ExpandableListView,但是隻有ExpandableListView中的第一個項目會顯示出來。不是我擁有的其他6個。仍然不知道爲什麼它不適合我。 – NightSkyLove