Linux 拨号vps windows公众号手机端

Android中tablelayout横向滑动怎么实现

lewis 6年前 (2019-04-06) 阅读数 16 #程序编程
文章标签 tablelayout

要在Android中实现TableLayout的横向滑动,可以使用HorizontalScrollView来包裹TableLayout。以下是一个示例代码:

<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<!-- 在这里添加TableLayout的内容 -->
</TableLayout>
</HorizontalScrollView>

这样,TableLayout就会被包裹在一个横向滑动的容器中,当TableLayout的内容超出屏幕宽度时,用户就可以通过水平滑动来查看所有内容。

版权声明

本文仅代表作者观点,不代表米安网络立场。

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

热门