1. <?xml version="1.0" encoding="utf-8"?>
  2. <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
  3. android:layout_width="fill_parent"
  4. android:layout_height="wrap_content" >
  5. <HorizontalScrollView
  6. android:layout_width="fill_parent"
  7. android:layout_height="wrap_content" >
  8. <RelativeLayout
  9. android:layout_width="fill_parent"
  10. android:layout_height="fill_parent"
  11. android:orientation="horizontal" >
  12. <TextView
  13. android:id="@+id/textview1"
  14. android:layout_width="wrap_content"
  15. android:layout_height="wrap_content"
  16. android:gravity="center_vertical"
  17. android:text="垂直和水平滚动"
  18. android:textSize="30dp" />
  19. <ImageView
  20. android:id="@+id/imageview1"
  21. android:layout_width="wrap_content"
  22. android:layout_height="wrap_content"
  23. android:layout_below="@id/textview1"
  24. android:src="@drawable/item1" />
  25. <ImageView
  26. android:id="@+id/imageview2"
  27. android:layout_width="wrap_content"
  28. android:layout_height="wrap_content"
  29. android:layout_toRightOf="@id/imageview1"
  30. android:layout_below="@id/textview1"
  31. android:src="@drawable/item2" />
  32. <TextView
  33. android:id="@+id/textview2"
  34. android:layout_width="wrap_content"
  35. android:layout_height="wrap_content"
  36. android:layout_below="@id/imageview1"
  37. android:text="垂直和水平滚动"
  38. android:textSize="30dp" />
  39. <ImageView
  40. android:id="@+id/imageview2"
  41. android:layout_width="wrap_content"
  42. android:layout_height="wrap_content"
  43. android:layout_below="@id/textview2"
  44. android:src="@drawable/item3" />
  45. </RelativeLayout>
  46. </HorizontalScrollView>
  47. </ScrollView>
    1. package net.blogjava.mobile;
    2. import android.app.Activity;
    3. import android.os.Bundle;
    4. public class Main extends Activity {
    5. /** Called when the activity is first created. */
    6. @Override
    7. public void onCreate(Bundle savedInstanceState) {
    8. super.onCreate(savedInstanceState);
    9. setContentView(R.layout.main);
    10. }
    11. }

Android学习笔记技巧之垂直和水平滚动视图的更多相关文章

  1. Android学习笔记技巧之给文本加边框

    BorderTextViews.Java package xiaosi.BorderTextView; import android.content.Context; import android.g ...

  2. 【转】Pro Android学习笔记(十三):用户界面和控制(1):UI开发

    目录(?)[-] UI开发 方式一通过XML文件 方式二通过代码 方式三XML代码 UI开发 先理清一些UI概念: view.widget.control:这三个名词其实没有什么区别,都是一个UI元素 ...

  3. 【转】Pro Android学习笔记(二五):用户界面和控制(13):LinearLayout和TableLayout

    目录(?)[-] 布局Layout 线性布局LinearLayout 表格布局TableLayout 布局Layout Layout是容器,用于对所包含的view进行布局.layout是view的子类 ...

  4. 【转】 Pro Android学习笔记(十九):用户界面和控制(7):ListView

    目录(?)[-] 点击List的item触发 添加其他控件以及获取item数据 ListView控件以垂直布局方式显示子view.系统的android.app.ListActivity已经实现了一个只 ...

  5. Android 学习笔记之Volley(七)实现Json数据加载和解析...

    学习内容: 1.使用Volley实现异步加载Json数据...   Volley的第二大请求就是通过发送请求异步实现Json数据信息的加载,加载Json数据有两种方式,一种是通过获取Json对象,然后 ...

  6. Android学习笔记进阶之在图片上涂鸦(能清屏)

    Android学习笔记进阶之在图片上涂鸦(能清屏) 2013-11-19 10:52 117人阅读 评论(0) 收藏 举报 HandWritingActivity.java package xiaos ...

  7. android学习笔记36——使用原始XML文件

    XML文件 android中使用XML文件,需要开发者手动创建res/xml文件夹. 实例如下: book.xml==> <?xml version="1.0" enc ...

  8. Android学习笔记之JSON数据解析

    转载:Android学习笔记44:JSON数据解析 JSON(JavaScript Object Notation)是一种轻量级的数据交换格式,采用完全独立于语言的文本格式,为Web应用开发提供了一种 ...

  9. udacity android 学习笔记: lesson 4 part b

    udacity android 学习笔记: lesson 4 part b 作者:干货店打杂的 /titer1 /Archimedes 出处:https://code.csdn.net/titer1 ...

随机推荐

  1. Myeclipse学习总结(4)——Eclipse常用开发插件

    (1)    AmaterasUML         介绍:Eclipse的UML插件,支持UML活动图,class图,sequence图,usecase图等:支持与Java class/interf ...

  2. PatentTips - Managing sequenced lock requests

    BACKGROUND In a multi-threaded processing environment, two or more threads may require access to a c ...

  3. HDU——T 2818 Building Block

    http://acm.hdu.edu.cn/showproblem.php?pid=2818 Time Limit: 2000/1000 MS (Java/Others)    Memory Limi ...

  4. MYSQL 更新时间自己主动同步与创建时间默认值共存问题

    本文作者:苏生米沿 本文地址:http://blog.csdn.net/sushengmiyan/article/details/50326259 在使用SQL的时候,希望在更新数据的时候自己主动填充 ...

  5. [Recompose] Pass a React Prop to a Stream in RxJS

    When you declare your Component and Props in JSX, you can pass those props along to your RxJS stream ...

  6. hdu4691 Front compression(后缀数组)

    Front compression Time Limit: 5000/5000 MS (Java/Others) Memory Limit: 102400/102400 K (Java/Others) ...

  7. hdoj--5053--the Sum of Cube(水)

    the Sum of Cube Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 32768/32768K (Java/Other) Tot ...

  8. BZOJ 1598 第k短路

    思路: 先反向建图 Dijkstra一遍 求出h数组 再正向建图 A_star一遍 搞定 //By SiriusRen #include <queue> #include <cstd ...

  9. Json 序列化以及反序列化的三种方式(二)

    1.什么是JSON? Json[javascript对象表示方法],它是一个轻量级的数据交换格式,我们可以很简单的来读取和写它,并且它很容易被计算机转化和生成,它是完全独立于语言的 2.Json支持下 ...

  10. Sub Thread to update main Thread (UI)

    Sub Thread to update main Thread (UI) main Thread :   A  has Hander.HandleMessage() to process the & ...