android 水平(左右)滚动 HorizontalScrollView
16lz
2021-12-04
android 水平(左右)滚动 HorizontalScrollView xml文件配置 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns: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:scrollbarAlwaysDrawHoriz ontalTrack="false"> <!--LinearLayout标签,用于存放滚动的内容 --> <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> 也可以定义滚动控件的属性: android:scrollbarAlwaysDrawVerticalTrack为false
</LinearLayout> 也可以定义滚动控件的属性: android:scrollbarAlwaysDrawVerticalTrack为false
更多相关文章
- android textview 跑马灯 滚动效果
- TextView 实现 滚动条
- Android中TextView如何实现水平和垂直滚动
- Android表情功能
- Android控制水平方向字体缩放android:textScaleX
- Android跑马灯效果,字体滚动滚屏效果
- Android配置文件中标签
- UI___tab view 的实现
- 安卓设置文字自动滚动