Java RelativeLayout内的水平滚动视图:在1.6+上运行良好;API,但不在1.5 API上

Java RelativeLayout内的水平滚动视图:在1.6+上运行良好;API,但不在1.5 API上,java,android,scrollview,horizontalscrollview,Java,Android,Scrollview,Horizontalscrollview,我使用的是水平滚动视图在相对视图中。它在1.6+API上运行良好,但在1.5 API上,HorizontalScrollView不滚动,这是什么问题 在1.5API(3)中,您只能看到水平滚动视图的第一部分,并且根本没有滚动,而在API4及以上版本中,它似乎工作正常 为了回答这个问题,这里使用了一些代码: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas

我使用的是
水平滚动视图
相对视图
中。它在1.6+API上运行良好,但在1.5 API上,
HorizontalScrollView
不滚动,这是什么问题

在1.5API(3)中,您只能看到
水平滚动视图的第一部分,并且根本没有滚动,而在API4及以上版本中,它似乎工作正常

为了回答这个问题,这里使用了一些代码:

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

xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:layout_width="fill_parent"    
android:layout_height="fill_parent"
android:orientation="vertical"     >   

<HorizontalScrollView
 android:id="@+id/pscroll"
android:scrollbars="horizontal"
android:orientation="horizontal"
android:layout_width="fill_parent"    
android:layout_height="wrap_content"
android:layout_below="@id/ad"
android:fillViewport="true"
android:scrollbarAlwaysDrawHorizontalTrack="true">      

<LinearLayout android:orientation="horizontal" android:id="@+id/LinearLayout01"       android:scrollbars="horizontal" android:layout_width="fill_parent"    android:layout_height="wrap_content">
                  <ImageButton android:id="@+id/P1"  android:layout_width="wrap_content" android:layout_height="wrap_content" />
           <ImageButton android:id="@+id/P2"  android:layout_width="wrap_content" android:layout_height="wrap_content"/>

编辑:根据负面反馈进行优化(显然,人们希望通过这种方式来控制自己的手)

滚动视图旨在包含布局,而不是相反的布局。因此,您的布局应为:

<HorizontalScrollView android:id="@+id/pscroll"
    android:scrollbars="horizontal" android:orientation="horizontal"
    android:layout_width="fill_parent" android:layout_height="wrap_content"
    android:layout_below="@id/ad" android:fillViewport="true"
    android:scrollbarAlwaysDrawHorizontalTrack="true">
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

        xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
        android:layout_width="fill_parent" android:layout_height="fill_parent"
        android:orientation="vertical">

        <LinearLayout android:orientation="horizontal"
            android:id="@+id/LinearLayout01" android:scrollbars="horizontal"
            android:layout_width="fill_parent" android:layout_height="wrap_content">
            <ImageButton android:id="@+id/P1" android:layout_width="wrap_content"
                android:layout_height="wrap_content" />
            <ImageButton android:id="@+id/P2" android:layout_width="wrap_content"
                android:layout_height="wrap_content" />
        </LinearLayout>
    </RelativeLayout>
</HorizontalScrollView>


您可以发布用于创建布局的标记吗?顺便说一句,为1.6版本之前的android开发类似于为windows 98开发现代应用程序。当然,有一些商业案例,但是。。。在某种程度上,你应该放手:)请仔细阅读这个问题是针对HorizontalScroll视图的,尽管它在1.6 API级别4下运行良好,但在1.5中无法正常工作。没有理由记下我的答案。他可以用“滚动视图”代替“水平滚动视图”。我确实读过这个问题,答案是他正在反转他放置布局和滚动视图的位置。scrollview应该包含一个布局,这就是我在这里提到的。我不会给出一个不需要思考就能理解的答案,而你显然没有理解我的答案。