微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

android – Horizo​​ntalScrollView中的TableLayout

我正在使用以下代码创建一个可水平滚动的TableLayout:

      <?xml version="1.0" encoding="utf-8"?>
      <horizontalscrollview xmlns:android="http://schemas.android.com/apk/res/android"
           android:layout_width="fill_parent"
           android:layout_height="fill_parent"
           android:minWidth="200dp"
           android:scrollbars="none">

       <TableLayout xmlns:android="http://schemas.android.com/apk/res/android"            android:id="@+id/maintable2"
                android:layout_width="fill_parent"                  
                android:layout_height="fill_parent"                     
                android:stretchColumns="*"                      
                android:background ="#dddddd"           
                android:scrollbars="none"   >       
       </TableLayout>               
   </horizontalscrollview>

我需要TableLayout中的列至少填满屏幕(即如果只有一列,那列的边框应该在整个屏幕上延伸,如果有两列,两列的边框应该填满屏幕等).

我怎样才能做到这一点?

解决方法:

我有同样的问题.我通过将android:fillViewport =“true”添加到Horizo​​ntalScrollView来解决它.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐