展会信息港展会大全

垂直和水平滚动视图 Android开发学习
来源:互联网   发布日期:2015-10-03 11:14:44   浏览:3408次  

导读:Android学习笔记技巧之垂直和水平滚动视图?xml version=1.0 encoding=utf-8?ScrollView xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent ......

Android学习笔记技巧之垂直和水平滚动视图

<?xml version="1.0" encoding="utf-8"?>

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"

android:layout_width="fill_parent"

android:layout_height="wrap_content" >

<HorizontalScrollView

android:layout_width="fill_parent"

android:layout_height="wrap_content" >

<RelativeLayout

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:orientation="horizontal" >

<TextView

android:id="@+id/textview1"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:gravity="center_vertical"

android:text="垂直和水平滚动"

android:textSize="30dp" />

<ImageView

android:id="@+id/imageview1"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_below="@id/textview1"

android:src="@drawable/item1" />

<ImageView

android:id="@+id/imageview2"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_toRightOf="@id/imageview1"

android:layout_below="@id/textview1"

android:src="@drawable/item2" />

<TextView

android:id="@+id/textview2"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_below="@id/imageview1"

android:text="垂直和水平滚动"

android:textSize="30dp" />

<ImageView

android:id="@+id/imageview2"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_below="@id/textview2"

android:src="@drawable/item3" />

</RelativeLayout>

</HorizontalScrollView>

</ScrollView>

package net.blogjava.mobile;

import android.app.Activity;

import android.os.Bundle;

public class Main extends Activity {

/** Called when the activity is first created. */

@Override

public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.main);

}

}

赞助本站

人工智能实验室

相关热词: 滚动

AiLab云推荐
展开

热门栏目HotCates

Copyright © 2010-2024 AiLab Team. 人工智能实验室 版权所有    关于我们 | 联系我们 | 广告服务 | 公司动态 | 免责声明 | 隐私条款 | 工作机会 | 展会港