Android 我如何获得大于屏幕大小的布局

Android 我如何获得大于屏幕大小的布局,android,performance,android-layout,android-view,swipe,Android,Performance,Android Layout,Android View,Swipe,我正在尝试创建一个xml布局,它有时可能比屏幕的宽度甚至高度都大。因为我将添加xml格式的表格,所以可能会出现布局宽度和高度超过屏幕宽度和高度的情况。我试着用下面的代码来解决这个问题- <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="wr

我正在尝试创建一个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都有,但它们在一个方向上工作,要么上下,要么左右。 我希望所有方向的刷顺利

我所做的一切都在一个片段中。


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >

<HorizontalScrollView
android:id="@+id/horizontalScrollView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:fillViewport="true"
android:scrollbars="horizontal" >

<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:orientation="horizontal" >

    <TableLayout
        android:id="@+id/bot_scoreBoard"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/table_shape"
        android:orientation="horizontal"
        android:stretchColumns="*" >

        <TableRow
            android:layout_height="fill_parent"
            android:layout_margin="2dp"
            android:background="#ffffff" >

            <TextView />
        more than 16 columns of made using TextView
 ....
        </TableRow>
    </TableLayout>
</LinearLayout>
使用TextView制作了超过16列的 ....

如果你想向所有方向滑动,那么这个库将对你非常有帮助

使用水平滚动视图它会在两个方面都有帮助吗?我是说向下滑动,向上滑动,左-右-所有方式您可以使用Horizontal scrollview进行此操作,因为您可能需要创建嵌套在HorizontalScrollView@Shubham Agarwal Bhewanewala中的scrollview。没有其他方法吗?更好的东西。是的,我可以用这个,但它只能左右帮助我。我忘了说我想在所有可能的方向上全方位滑动。好的,那么我想这个库会对你有帮助的。谢谢,这是一个很大的帮助。还没有特权。你将有向上投票的特权,因为你问了这个问题,你可以接受我的答案。我会编辑它。