android屏幕页面实现滚动,页面跳转
来源:互联网 发布:数据使用保密协议范本 编辑:程序博客网 时间:2024/05/17 08:38
在
在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屏幕页面实现滚动,页面跳转
- android屏幕页面实现滚动,页面跳…
- Android 实现页面跳转
- JS 实现鼠标滚动页面跳转
- android页面跳转的实现
- Android Fragment 实现页面跳转
- Android Activity页面跳转实现
- 鼠标上下滚动跳转页面。
- jquery mobile如何实现滑动屏幕跳转页面
- android 仿京东,滚动屏幕标题栏渐变+(启动页面动画)
- Android---ScrollView实现页面滚动效果
- Android开发实现页面的跳转
- Android开发 单击按钮实现页面跳转
- Android页面跳转实现方法:activity&TabActivity
- Android学习之Intent实现页面跳转
- Android 实现页面跳转并传递参数
- Android使用Intent实现页面跳转
- Android入门-SayHello实现页面跳转
- C# 判断批处理是否完成 方法
- Linux core dump的调试技术
- Linux core dump的调试技术
- Centos 中文方框乱码解决方案
- [转载]云计算时代的操作系统
- android屏幕页面实现滚动,页面跳转
- eax ...edi esp ebp寄存器简介(转)
- linux 环境变量详解
- C++写的集合的交叉并
- C++写的集合的交叉并
- VS生成过程的管理
- 空间复杂性学习笔记(space complexity)
- 值传递 引用传递的生活案例
- TIFF图像文件格式详解(2)