如何使一个LinearLayout中滚动 [英] How to make a LinearLayout scrollable

查看:100
本文介绍了如何使一个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>

我的类code是

My class code is

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);
    }
}

的输出是<一个href="http://img265.imageshack.us/img265/7601/linearlayout.jpg">http://img265.imageshack.us/img265/7601/linearlayout.jpg

推荐答案

将布局在滚动型

这篇关于如何使一个LinearLayout中滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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