android– 如何使LinearLayout可滚动?

android– 如何使LinearLayout可滚动?,第1张

概述在我开始活动后,我无法向下滚动以查看下面定义的xml中的其他按钮和选项.有谁知道如何使这个可滚动?<?xmlversion="1.0"encoding="utf-8"?><LinearLayoutxmlns:android="http://schemas.android.com/apkes/android"android:layout_height="wrap_content"an

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

有谁知道如何使这个可滚动?

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

解决方法:

将您的布​​局放在ScrollView中.

总结

以上是内存溢出为你收集整理的android – 如何使LinearLayout可滚动?全部内容,希望文章能够帮你解决android – 如何使LinearLayout可滚动?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://www.54852.com/web/1102999.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-28
下一篇2022-05-28

发表评论

登录后才能评论

评论列表(0条)

    保存