在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. 归并排序(C语言)

    合并排序(MERGE SORT)是又一类不同的排序方法,合并的含义就是将两个或两个以上的有序数据序列合并成一个新的有序数据序列,因此它又叫归并算法. 它的基本思想就是假设数组A有N个元素,那么可以看成 ...

  2. NET怎么精确计算一个对象占用的内存空间(GMK)

    NET如何精确计算一个对象占用的内存空间(GMK)如题 我最近做了一个类似Session的东西 但是我不知道最后管理起来他又多大 所以内存 对象 管理 session 类 分享到: ------解决方 ...

  3. 【转】ubuntu 12.04 下 Vim 插件 YouCompleteMe 的安装

    原文网址:http://www.cnblogs.com/jostree/p/4137402.html 作者:jostree 转载请注明出处 http://www.cnblogs.com/jostree ...

  4. 使用SafeViewFlipper避免ViewFlipper交替时Crash

    使用SafeViewFlipper避免ViewFlipper交替时Crash 柳志超博客 » Program » Andriod » 使用SafeViewFlipper避免ViewFlipper交替时 ...

  5. VS2015 Git 源代码管理工具使用记录

    1. 首先到源代码托管平台申请个账户:https://git.oschina.net/ 2.创建流程图: 2.1 开始创建项目: 2.2 3. 4.

  6. 语音-数字中继-E1-学习帖

     1.电话线,俗称数字中继,模拟线路,一门电话线只能跑一个电话号码,用模拟语音卡:2.光纤,信令有两种30B+D(也叫pri信令)或者7号信令,数字线路,一路可以跑30路电话,用数字语音卡:数字语音卡 ...

  7. while循环优化版本-for循环

    for i in range(0,10): if i <3: print("loop ",i) else : continue print("hehe...&quo ...

  8. php 数字格式化

    php 数字格式化 1.位数不足前面补0 <?php for($i=1; $i<=17 ;$i++){ $var = sprintf("0%3d",$i); echo ...

  9. OSG和ProLand 的海面仿真

    基于OSG的海面仿真 OSG中国官网 http://www.osgchina.org/ OSG-ocean的效果图如下 proland的效果图如下 下面为OSG和OCEAN的配置 配置方法转自 htt ...

  10. 浅谈Laravel框架的CSRF

    前文 CSRF攻击和漏洞的参考文章: http://www.cnblogs.com/hyddd/archive/2009/04/09/1432744.html Laravel默认是开启了CSRF功能, ...