是否可以在不导入 android ScrollView class 的情况下创建滚动视图对象?

Is it possible to create a scrollview object without importing the android ScrollView class?

我正在尝试解释 Java 代码,但我不知道如何在不导入 ScrollView class 的情况下创建 ScrollView 对象。谁能解释为什么这是可能的?我也没有在 XML 文件中看到任何 ScrollView 标签。这是以下代码:

MainActivity.Java

import android.os.Bundle;
import android.app.Activity;
import android.graphics.Color;
import android.view.Gravity;
import android.view.View;
import android.widget.*;

public class Form extends Activity {

    ScrollView sv;
    TableLayout myLayout;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        sv = new ScrollView(this);
        myLayout = new TableLayout (this);
        drawScreen();
    }
    //more code...
    ///....

activity_main.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".MainActivity" >

    <TextView
      android:id="@+id/text1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:id="@+id/textView"
    />

</RelativeLayout>
import android.widget.*;

导入 android.widget 下的所有内容,包括 ScrollView。