Code Bye

android不能滚动

本人的首页里,动态加载完数据后,超出窗口的部分就不显示了,而且也不不能下滑,有人知道原因么?

在线等解决方法。
解决方案

10

<ScrollView 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" >
<RelativeLayout 
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >
 
    <LinearLayout
        android:id="@+id/index_layout_title"
        android:layout_width="fill_parent"
        android:layout_height="30dp"
        android:orientation="horizontal" >
 
        <TextView
            android:id="@+id/textView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/index_title" />
    </LinearLayout>
 
    <com.copy_food.android.view.BannerView
        android:id="@+id/index_banner"
        android:layout_width="match_parent"
        android:layout_height="140dp"
        android:layout_marginTop="30dp" >
    </com.copy_food.android.view.BannerView>
 
    <LinearLayout
        android:id="@+id/linearLayout2"
        android:layout_width="match_parent"
        android:layout_height="70dp"
        android:layout_below="@+id/index_layout_nav1"
        android:layout_marginTop="172dp"
        android:orientation="horizontal" >
 
        <ImageButton
            android:id="@+id/index_ib_news"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginRight="2dp"
            android:layout_weight="1.0"
            android:src="@drawable/ic_grid_tab_news" />
 
        <ImageButton
            android:id="@+id/index_ib_grouppur"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginRight="2dp"
            android:layout_weight="1.0"
            android:src="@drawable/ic_grid_tab_grouppurchase" />
 
        <ImageButton
            android:id="@+id/index_ib_weibo"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginRight="2dp"
            android:layout_weight="1.0"
            android:src="@drawable/ic_grid_tab_weibo" />
 
        <ImageButton
            android:id="@+id/index_ib_bargains"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1.0"
            android:src="@drawable/ic_grid_tab_bargains" />
    </LinearLayout>
 
    <LinearLayout
        android:id="@+id/linearLayout1"
        android:layout_width="match_parent"
        android:layout_height="70dp"
        android:layout_below="@+id/index_layout_nav2"
        android:layout_marginTop="244dp"
        android:orientation="horizontal" >
 
        <ImageButton
            android:id="@+id/index_ib_weixin"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginRight="2dp"
            android:layout_weight="1.0"
            android:src="@drawable/ic_grid_tab_weixin" />
 
        <ImageButton
            android:id="@+id/index_ib_product"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginRight="2dp"
            android:layout_weight="1.0"
            android:src="@drawable/ic_grid_tab_product" />
 
        <ImageButton
            android:id="@+id/index_ib_shake"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginRight="2dp"
            android:layout_weight="1.0"
            android:src="@drawable/ic_grid_tab_shake" />
 
        <ImageButton
            android:id="@+id/index_ib_supply"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1.0"
            android:src="@drawable/ic_grid_tab_supply" />
    </LinearLayout>
 
    <LinearLayout
        android:id="@+id/index_layout_newsinfo"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="310dp"
        android:orientation="vertical" >
    </LinearLayout>
 
</RelativeLayout>
</ScrollView>

这样

10

起始按照现在这个界面,为什么不使用ListView呢
还有android:scrollbars=”none” ScrollView 可以不显示滑动条的

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明android不能滚动