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 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器