myq_26 2013-08-29 06:56 采纳率: 16.7%
浏览 8277

android 布局中的滚动功能

我想在屏幕的整个布局上实现滚动的功能,在 ScrollView 中加入 Linearlayout,但是不能实现滚动的功能。下面是 layout 代码:

<?xml version="1.0" encoding="utf-8"?>
<ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:id="@+id/ScrollView01"
    >

<LinearLayout  
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:orientation="vertical"
  android:paddingTop="50dp"
  android:weightSum="1"
  android:layout_marginTop="67dp"
  >

    <ImageView 
        android:id="@+id/artistImageView"
        android:layout_width="fill_parent"
        android:layout_height="150dp"
        android:paddingTop="10dp"
        android:layout_marginTop="67dp"
        android:background="#000000"
    />

    <TextView
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content"
        android:text="BIOGRAPHY"
        android:textColor="#eeeeee"
        android:background="#000000"
        android:id="@+id/txt1"
    />          
    <ImageView
        android:src="@drawable/separator_bio"
        android:scaleType="fitXY"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"            
        android:background="#000000"
        android:id="@+id/sep1"
    />                  
    <TextView  
        android:id="@+id/artistView" 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content"         
        android:textStyle="bold"
        android:textColor="#ffffff"              
        android:paddingLeft="10dp"
        android:paddingRight="5dp"        
        android:background="#000000"
    />
</LinearLayout>
</ScrollView>
  • 写回答

1条回答

  • JaveZh 2013-08-30 08:05
    关注

    把这句去掉试试:
    android:weightSum="1"

    评论

报告相同问题?

悬赏问题

  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题