编辑:不幸的是,我仍然没有与这个问题取得进展。我想这是男子气概,因为我是一名Android初学者。任何意见或建议都将受到高度赞赏(这是我在工作中遇到的问题)。我应该提供其他信息还是我的问题缺少任何重要内容?
我正在使用此库为我的应用程序提供可排序的表格视图:https : //github.com/ISchwarz23/SortableTableView。因为该应用程序应该在智能手机上锁定为纵向模式,所以我将视图放入HorizontalScrollView中,以便用户可以滚动查看不同的列。我的问题是,每当我在列标题上使用Tab键对表格进行排序时,表格就会变得有点宽。您是否知道是什么原因引起的,或者我如何防止它发生?
如果您想亲自查看它,则足以导入克隆存储库并对其稍作修改时所包含的库的示例应用程序。只需将tableview放入HorizontalScrollView中,您已经可以看到此行为。
main_activity.xml如下所示:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:custom="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="de.codecrafters.tableviewexample.MainActivity">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/primary"
custom:title="@string/title_activity_main"
custom:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />
<android.widget.HorizontalScrollView
android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_height="match_parent">
<de.codecrafters.tableviewexample.SortableCarTableView
android:id="@+id/tableView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/toolbar"
custom:columnCount="4"
custom:headerElevation="10"
custom:headerColor="@color/primary" />
</android.widget.HorizontalScrollView>
</RelativeLayout>
如果您需要其他信息,请告诉我。任何帮助都非常感谢!:)
不幸的是,我无法重现肖像模式的锁定,但是由于您的问题描述非常详细,因此我能够轻松重现调整大小的问题。
很高兴告诉您,我能够解决您所举示例的问题。请将您的依赖关系更新到最新版本(0.9.6),然后告诉我,是否确实为您解决了该问题。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句