如何使LinearLayout可滚动? [英] How do I make a LinearLayout scrollable?

查看:137
本文介绍了如何使LinearLayout可滚动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始活动后,无法向下滚动以查看下面定义的xml中的其他按钮和选项.

After I start the activity I am unable to scroll down to see other buttons and options in the xml defined below.

有人知道如何使它可滚动吗?

Does anyone know how to make this scrollable?

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
 xmlns:android="http://schemas.android.com/apk/res/android"
 android:layout_height="wrap_content"
 android:layout_width="fill_parent"
 android:background="#000044"
 android:isScrollContainer="true"
 android:orientation="vertical">
 <TextView
  android:id="@+id/title"
  android:text="@string/title"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:textColor="#ffffff"/>
 <EditText
  android:id="@+id/editTitle"
  android:text=""
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"/>
 <TextView
  android:id="@+id/description"
  android:text="@string/description"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:textColor="#ffffff"/>
 <EditText
  android:id="@+id/editDescription"
  android:text=""
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"/>
 <TextView
  android:id="@+id/location"
  android:text="@string/location"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:textColor="#ffffff"/>
 <EditText
  android:id="@+id/editLocation"
  android:text=""
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"/>
 <TextView
  android:id="@+id/startTime"
  android:text="@string/startTime"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:textColor="#ffffff"/>
 <DatePicker 
  android:id="@+id/DatePicker01" 
  android:layout_width="wrap_content" 
  android:layout_height="wrap_content" />
 <TimePicker 
  android:id="@+id/TimePicker01" 
  android:layout_width="wrap_content" 
  android:layout_height="wrap_content"/>
 <TextView
  android:id="@+id/endTime"
  android:text="@string/endTime"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:textColor="#ffffff"/>
 <DatePicker 
  android:id="@+id/DatePicker02" 
  android:layout_width="wrap_content" 
  android:layout_height="wrap_content" />
 <TimePicker 
  android:id="@+id/TimePicker02" 
  android:layout_width="wrap_content" 
  android:layout_height="wrap_content"/>
 <Button
  android:id="@+id/buttonCreate"
  android:text="Create"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"/>
</LinearLayout>

我的班级代码是

package com.example.blah;

import android.app.Activity;
import android.os.Bundle;

public class example extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }
}

推荐答案

将布局放置在 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆