在LinearLayout外面包一层ScrollView即可,如下代码

Apidemo 中关于如何使用ScrollView说明,请参考:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scrollbars="none">

<LinearLayout
       android:id="@+id/layout"
       android:orientation="vertical"
       android:layout_width="fill_parent" android:layout_height="wrap_content">

<TextView
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:text="@string/scroll_view_1_text_1"/>

<Button
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:text="@string/scroll_view_1_button_1"/>
<TextView
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:text="@string/scroll_view_1_text_6"/>

<Button
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:text="@string/scroll_view_1_button_6"/>

</LinearLayout>
</ScrollView>
2:页面跳转的实现(不同activity间的切换)

java代码 加在button哪里同时在AndroidManifest.xml 哪里加上一句话,放在第一个activity 的下面

xml:代码:

<activity android:name="BCD" android:label="@string/bcd_title"></activity>

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      android:versionCode="1"
      android:versionName="1.0" package="com.demo.android.AutoGnosis">
    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".AutoGnosis"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name="BCD" android:label="@string/bcd_title"></activity> //添加标签属性与values/report.xml对应

</application>
    <uses-sdk android:minSdkVersion="3" />

</manifest>

跳转代码:

private void setListensers() {
    Log.d(TAG,"set Listensers");
   button_next.setOnClickListener(bt_next); 
}
    private Button.OnClickListener bt_next = new Button.OnClickListener(){
    public void onClick(View v){
      //switch to BDC page跳转到BDC.class
      Intent intent = new Intent();
       intent.setClass(AutoGnosis.this, BCD.class);
       startActivity(intent);    
       Intent intent = new Intent();
       intent.setClass(Bmi.this, Report.class);
       Bundle bundle = new Bundle();   //bundle带参数跳转
       bundle.putString("KEY_HEIGHT",field_height.getText().toString());
       bundle.putString("KEY_WEIGHT",field_weight.getText().toString());
       intent.putExtras(bundle);
       startActivity(intent);
    } 
    };

android屏幕页面实现滚动,页面跳转的更多相关文章

  1. vue使用原生js实现滚动页面跟踪导航高亮

    需要使用vue做一个专题页面. 滚动页面指定区域导航高亮. BetterScroll:可能是目前最好用的移动端滚动插件 如何自定义CSS滚动条的样式? 监听滚动页面事件,对比当前页面的位置与元素的位置 ...

  2. vue2.0 页面A跳转到页面B,B页面停留在A页面的滚动位置的解决方法

    如果页面A沿Y轴滚动一段距离,然后跳转到页面B: 在进入B页面时,B页面已经滚到页面A的距离,返回页面A,发现A还在之前的滚动位置: 这样体验就很不好,所以我们要进行一些处理: 我的方法是:在路由守卫 ...

  3. vue滚动行为控制——页面跳转返回上一个页面保留滚动位置

    需求分析: 一般这个功能在后台管理系统用的比较多,因为后台页面都是在当前页面打开,对于某些列表筛选页,如果列表数据比较多,页面就会滚动.当页面发生滚动,对列表数据进行查看或者编辑的时候,跳转到下一级页 ...

  4. Android 完美解决bundle实现页面跳转并保留之前数据+传值

    1.前言 前言: 昨天碰到了一个问题,我想实现页面跳转,采用了Bundle之后,再回到原来的页面,发现数据也没有了, 而且一直报错,网上查找了很多资料,发现要用一个startActivityForRe ...

  5. Android滚动页面位置指示器:CircleIndicator

     Android滚动页面位置指示器:CircleIndicator CircleIndicator是github上的一个开源的用于页面滚动时候的位置指示器,指示当前页面在总的页面中的位置和前后位置 ...

  6. 移动端touch事件影响click事件以及在touchmove添加preventDefault导致页面无法滚动的解决方法

    这两天自己在写一个手机网页,用到了触屏滑动的特效,就是往右滑动的时候左侧隐藏的菜单从左边划出来. 做完之后在手机原生浏览器中运行正常,但在QQ和微信中打开,发现touchmove只会触发一次,而且to ...

  7. dragloader.js帮助你在页面原生滚动下实现Pull Request操作

    dragloader.js是一个面向移动Web开发的JavaScript库,帮助开发者在使用页面原生滚动时,模拟上/下拉手势,实现Pull Request操作. 在移动设备上,一般会使用 drag d ...

  8. 浅谈jQuery页面的滚动位置scrollTop、scrollLeft

    Web页面常常比显示该页面的浏览器窗口还要大,因为Web文档具有很多内容,往往会导致页面比浏览器还要高,有时候甚至还要宽,这迫使访问者通过滚动来查看整个页面(如图10-8所示).当访问者滚动页面的时候 ...

  9. jQuery.smoove — jQuery和CSS3炫酷滚动页面内容元素动画特效插件

    插件介绍: jQuery-smoove是一款jQuery和CSS3炫酷滚动页面内容元素动画特效插件.该内容元素动画插件在页面滚动到指定位置时,该位置的HTML元素会执行指定的CSS3动画特效,如旋转. ...

  10. 解决TabActivity中子页面不通过导航跳转到还有一个页面的问题

    问题:当你的导航在TabActivity中 而子页面的一个button须要切换到当中的某一个导航页面 转载请注明出处:http://blog.csdn.net/x605940745 demo下载地址: ...

随机推荐

  1. html5 data属性的使用

    html5 data属性定义和用法 <ul> <li data-animal-type="bird">Owl</li> <li data- ...

  2. 开始SDK之旅-入门2-集成流程图、轨迹图到系统

    http://bbs.ccflow.org/showtopic-2562.aspx 经测试,基本可用,还需增加 WF/Admin/pub.ascx 首先你得先理解流程图的数据的获取方式,其他的就很容易 ...

  3. C#自带缓存方案

    /// <summary> /// 获取数据缓存 /// </summary> /// <param name="CacheKey">键< ...

  4. mysql 统计一个列不同值的数量

    SELECT count(status = 0 OR NULL) AS a, count(status = 1 OR NULL) AS b, count(status = 2 OR NULL) AS ...

  5. Java 学习思路

    内容中包含 base64string 图片造成字符过多,拒绝显示

  6. mysql错误:Can’t create TCP/IP socket (10106) 解决方法

    错误描述 “mysql错误:Can’t create TCP/IP socket (10106)”,目测是socket端口被占用的原因,然后在打开tomcat,报的错误中也包含了“socket”,再一 ...

  7. Unity容器声明周期管理

    Having said that, here is a solution that you can use with the Unity container: Create some custom a ...

  8. MVVMLight介绍以及在项目中的使用

    http://www.des8.me/detail-1822826.html 一.MVVM 和 MVVMLight介绍 MVVM是Model-View-ViewModel的简写.类似于目前比较流行的M ...

  9. tomcat下载安装和配置

    Tomcat服务器 1.Web开发中的常见概念 (1)B/S系统和C/S系统 Brower/Server:浏览器 服务器 系统 ----- 网站 Client/Server:客户端 服务器 系统 -- ...

  10. [Z] Windbg以及vs debug使用

    Windbg 一篇中国人写的质量非常高的Windbg文章:篇中国人写的质量非常高的Windbg文章: http://www.yiiyee.cn/Blog/windbg/ code project上的W ...