ndroid屏幕页面实现滚动,页面跳转

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

Apidemo 中关于如何使用ScrollView说明,请参考:

android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scrollbars="none">

android:id="@+id/layout"
androidrientation="vertical"
android:layout_width="fill_parent" android:layout_height="wrap_content">

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

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

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



2:页面跳转的实现(不同activity间的切换)

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

xml:代码:


http://schemas.android.com/apk/res/android"
android:versionCode="1"
android:versionName="1.0" package="com.demo.android.AutoGnosis">


android:label="@string/app_name">





//添加标签属性与values/report.xml对应


跳转代码:

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

更多相关文章

  1. android中系统自带样式
  2. Orientation to Android(安卓)Training
  3. Android(安卓)开发技巧之 手动拖动滚动条快速滑动
  4. 安卓布局属性代码中文注解
  5. Android(安卓)Tabhost中tab添加数字demo
  6. Android短信的发送和广播接收者实现短信的监听
  7. Android异步处理四:AsyncTask的实现原理
  8. Android异步处理四:AsyncTask的实现原理
  9. Android异步处理四:AsyncTask的实现原理 .

随机推荐

  1. Volley+Gson
  2. Groovy XML文件/文本处理
  3. android状态栏下载
  4. android WIFI相关问题集合
  5. Mastering the Android(安卓)Media Frame
  6. Top 5 Crashes on Android
  7. kotlin超简单recyclerView测试
  8. Android中一些很帅气的属性
  9. Android(安卓)ADT Bundle 0917,SDK Tools
  10. BDLocationListener doesn't work