是否有可能在ExpandableListView下有东西?

时间:2011-02-14 09:22:16

标签: android android-widget

我无法创建我将拥有的布局

<LinearLayout>
    <TextView/>
    <ExpandableListView/>
    <Button/>
</LinearLayout>

一般情况下,我无法在ExpandableListView下构建包含小部件的布局,是否可能?

[编辑]

现在我有另一个问题。目前我有这样的事情:

---------------------
|  some text which  |
| could be dragable |
|-------------------|
|ExpandableList  [|]|
|  - item1        | |
|  - item2        | |
|  - item3        | |
|  - item4        | |
|  - item5        | |
|-------------------| 
| [button] [button] |
---------------------

我可以滚动我的可扩展列表视图

---------------------
|  some text which  |
| could be dragable |
|-------------------|
|  - item4        | |
|  - item5        | |
|  - item6        | |
|  - item7        | |
|  - item8        | |
|  - item9       [|]|
|-------------------| 
| [button] [button] |
---------------------

但在风景中

------------------------------|
|   some text which could be  |
|          dragable           |   
|-----------------------------|
|-----------------------------| 
|      [button][button]       |
-------------------------------

我没有可扩展列表视图的位置。我应该实现完全可滚动的结果?

1 个答案:

答案 0 :(得分:3)

is it possible?

是的,我们可以将任何小部件(按钮或文本视图)放在可扩展列表视图的上方或下方。

最好发布用于创建布局的代码。所以我们会很容易地知道确切的问题。

例如:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">

    <ExpandableListView 
        android:id="@+id/expandableListView1" 
        android:layout_height="wrap_content" 
        android:layout_width="fill_parent">
    </ExpandableListView>

    <Button 
                android:text="Button" android:id="@+id/button2"            
                android:layout_width="wrap_content" 
                android:layout_height="wrap_content">
    </Button>

</LinearLayout>
相关问题