这是一个水平滚动的例子. main.xml HorizontalScrollView 对应的是Horizontal布局应用的. android 水平滚动 HorizontalScrollView_第1张图片

看代码:
<?xml version="1.0" encoding="utf-8"?> <LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent"> <HorizontalScrollView android:layout_height="wrap_content" android:layout_width="fill_parent" android:scrollbarAlwaysDrawHorizontalTrack="false"> <LinearLayout android:id="@+id/LinearLayout02" android:layout_width="wrap_content" android:orientation="horizontal" android:layout_height="fill_parent"> <Button android:text="1" android:id="@+id/Button01" android:layout_width="200px" android:layout_height="wrap_content" /> <Button android:text="2" android:id="@+id/Button02" android:layout_height="wrap_content" android:layout_width="200px" /> <Button android:text="3" android:id="@+id/Button03" android:layout_width="200px" android:layout_height="wrap_content" /> <Button android:text="4" android:id="@+id/Button04" android:layout_width="200px" android:layout_height="wrap_content" /> <Button android:text="5" android:id="@+id/Button05" android:layout_width="200px" android:layout_height="wrap_content" /> <Button android:text="6" android:id="@+id/Button06" android:layout_height="wrap_content" android:layout_width="200px" /> <Button android:text="7" android:id="@+id/Button07" android:layout_width="200px" android:layout_height="wrap_content" /> <Button android:text="8" android:id="@+id/Button08" android:layout_width="200px" android:layout_height="wrap_content" /> </LinearLayout> </HorizontalScrollView>

</LinearLayout>

更多相关文章

  1. android的布局属性中padding和margin的区别
  2. android FlexboxLayout可伸缩布局
  3. Android 用源代码写layout布局
  4. android webview在弹出软键盘时,布局没有上移的解决办法
  5. android第三天--AbsoluteLayout绝对布局
  6. Android Layout Tricks #3: Optimize with stubs(Android 布局技
  7. Android 关于显示键盘,布局错乱网上顶的问题
  8. android 开发 简单的页面布局

随机推荐

  1. XAMPP附带的mysql如何修改密码
  2. MySQL 转换函数与运算符
  3. MySQL数据库相关开发入门
  4. php&input复选框存储每个循环的值
  5. MySQL使用二进制日志来恢复数据
  6. windows下安装mysql5.6解压版,32位和64位
  7. Mysql的存储引擎之:MyISAM存储引擎
  8. Mysql基础之 基础知识解释
  9. 如何向mysql数据库添加多个映像?
  10. Sql查询性能限制行数之间的差异