【发布时间】:2017-03-06 11:02:55
【问题描述】:
我正在尝试创建一个 xml 布局,它有时可能比屏幕的宽度大,甚至可能是高度。因为我将在 xml 中添加表格,所以可能会出现布局宽度和高度超过屏幕宽度和高度的情况。我试图用下面的代码弄清楚-
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="match_parent"
tools:context="com.example.shaby.payshare.WorkPageOneFragment">
<TableLayout
android:layout_width="800dp"
android:layout_height="400dp">
</TableLayout>
</RelativeLayout>
这里发生的正是视图中的额外部分被隐藏了。 但我想要的是看到隐藏的视图,并且当我朝那个目前不可能的方向滑动时,对它有类似的控制,就像在整个视图中一样。有没有可能实现?如果是,我该如何通过它?
重要 ScrollView 和 HorizontalScrollView 在那里,但它们在一个方向上上下或左右工作。 我希望所有方向都顺畅滑动。
我在片段中所做的一切。
【问题讨论】:
-
使用水平滚动视图
-
这两种方式都有帮助吗?我的意思是向下、向上、向左滑动所有方式
-
你可以像这样使用水平滚动视图
-
为此,您可能需要创建一个嵌套在 HorizontalScrollView @Shubham Agarwal Bhewanewala 内的 ScrollView
-
没有其他办法了吗?更好的东西。
标签: android performance android-layout android-view swipe