繁体   English   中英

在Android开发中是否可以使用ScrollView在LinearLayout中添加多个TableLayout?

[英]Is it possible to add more than one TableLayout in a LinearLayout with a ScrollView in Android development?

我组成了这个漂亮的android应用程序,打算添加一些画龙点睛的内容,其中之一包括一个包含两个表的页面,结果发现我做不到。 基本上,我试图制作一个带有某些值的表(跨4或5列),然后在下面制作另一个表的不同值(仅2列)。 表格将超出屏幕,因此需要ScrollView。 但是,当我将所有这些放在一起时,会出现一个错误:ScrollView只能容纳一个直接子代。 我试过将其放在LinearLayout中。 那什么也没做。 一世

是的,您可以使用更多的TableLayout,但是在滚动视图中只需要一个父布局

<Scrollview>
      <LinearLayout> //parent layout
          <TableLayout>
           <TableRow></TableRow>
            </TableLayout>
           <TableLayout>
          <TableLayout>
         </TableLayout>
        </TableLayout>
     <LinearLayout>
<Scrollview>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM