【问题标题】:android xml scrollview showing scroll bar even without any element ... WHY?android xml scrollview 即使没有任何元素也显示滚动条......为什么?
【发布时间】:2014-04-23 12:20:52
【问题描述】:

我在我的 android 项目的 Xml 文件中使用滚动视图。用户必须在运行时拖放其中的元素。 最初它的元素为零。我已经调整了它的高度,以便一次显示 2 个元素。

现在我想要的是当它的元素计数是 0,1,2 时;它不应该显示任何滚动条,只有当元素数量超过2时才会出现滚动条。

我该怎么做?

【问题讨论】:

  • 发布您的布局文件。我认为您的布局有误。

标签: android xml user-interface layout scrollview


【解决方案1】:

您可以使用它来根据您的布局项自动调整滚动视图。

<ScrollView

    android:layout_width="fill_parent"
    android:layout_height="match_parent" >
    <LinearLayout

        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" >
    Use your contents here
   </LinearLayout>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-09
    • 2017-07-20
    • 1970-01-01
    • 2016-12-20
    • 1970-01-01
    • 2011-11-05
    相关资源
    最近更新 更多