In android, we can scroll the elements in both horizontal and vertical format. To scroll in Vertical we can use Scrollview, to scroll in horizontal format we need to use HorizontalScrollview.
Example for HorizontalScrollview :-

01 <?xmlversion="1.0"encoding="utf-8"?>
02 <LinearLayoutandroid:id="@+id/LinearLayout01"
03 android:layout_width="fill_parent"
04 android:layout_height="fill_parent"
05 xmlns:android="http://schemas.android.com/apk/res/android">
06 // Adding Scrollview
07 <ScrollViewandroid:id="@+id/ScrollView01"
08 android:layout_height="110px"
09 android:layout_width="wrap_content"
10 android:scrollbars="horizontal|vertical">
11 // Adding HorizontalScrollview
12 <HorizontalScrollViewandroid:id="@+id/HorizontalScrollView01"
13 android:layout_height="fill_parent"
14 android:layout_width="wrap_content">
15 <LinearLayoutandroid:id="@+id/LinearLayout02"
16 android:layout_width="wrap_content"
17 android:orientation="vertical"
18 android:layout_height="fill_parent">
19 <Buttonandroid:text="1"
20 android:id="@+id/Button01"
21 android:layout_width="wrap_content"
22 android:layout_height="wrap_content"/>
23 <Buttonandroid:text="2"
24 android:id="@+id/Button02"
25 android:layout_height="wrap_content"
26 android:layout_width="400px"/>
27 <Buttonandroid:text="3"
28 android:id="@+id/Button03"
29 android:layout_width="wrap_content"
30 android:layout_height="wrap_content"/>
31 </LinearLayout>
32 </HorizontalScrollView>
33 </ScrollView>
34 </LinearLayout>

The output will looks like

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. [Android]_[ACtivity生命周期]
  2. android 更新界面视图 Handler和runOnUiT
  3. Android如何通过手机自动获取短信验证码
  4. 玩转Android---UI篇---EditText(编辑框)
  5. Android(安卓)Navigation Drawer简记
  6. Android(安卓)Audio AudioStreamOutALSA:
  7. Android中notifyDataSetInvalidated()和n
  8. Activity生命周期介绍
  9. ListView属性及方法android
  10. Android国际化中用到的国家/地区 语言缩