2014-03-29 40 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