【问题标题】:android - HorizontalScrollView to list child of ExpandableListViewandroid - Horizo​​ntalScrollView 列出 ExpandableListView 的子项
【发布时间】:2014-01-23 10:40:08
【问题描述】:

我使用这个 tut http://www.androidhive.info/2013/07/android-expandable-list-view-tutorial/ 知道如何在 android 中使用 expanablelistview 但我有一个问题,我的表单的许多子视图需要很长的文本,然后它会自动下降到第二行。我只想要单行,所以我向 list_item.xml 添加了一个 Horizo​​ntalScrollView,如下所示:

 <HorizontalScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/lblListItem"
            android:textSize="17dp"/>

    </HorizontalScrollView>

它有效,但每个孩子都会得到一个卷轴,..aww(我知道它会发生但不知道) 这个问题的一些解决方案? 谢谢

【问题讨论】:

标签: android listview android-listview scrollview expandablelistview


【解决方案1】:

它没有被清除如果你不想显示滚动条然后试试这个

<HorizontalScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:scrollbars="none">

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/lblListItem"
            android:singleLine="true"
            android:textSize="17dp"/>

    </HorizontalScrollView>

【讨论】:

    猜你喜欢
    • 2012-10-04
    • 1970-01-01
    • 1970-01-01
    • 2011-10-18
    • 2014-02-13
    • 2017-04-09
    • 2021-07-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多